Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Restrict user to create subtasks on specific status

Umar Maroof
Contributor
December 21, 2022

Can we restrict users from creating subtasks when they are on specific status.

For example, I have 3 statuses

TO DO 

IN PROGRESS

DONE 

I want user can create subtasks when they are on TO DO status but when they are on IN PROGRESS, they can't create subtasks.

3 answers

2 accepted

1 vote
Answer accepted
David Fischer
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 21, 2022

Hi @Umar Maroof ,

using JMWE, you can add a "Linked Issues Status Validator (JMWE app)" to the Create transition of the sub-task workflow with a configuration like this:

image.png

Umar Maroof
Contributor
December 21, 2022

 

@David Fischer Thankyou so much 

I have one more question can we restrict user to linking the task to sprint (only when they are on specific status can link the task to sprint).

David Fischer
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 22, 2022

Unfortunately, that's not possible. The only thing you could do would be to add an Event-based Action to notify the user that they shouldn't change the Sprint field and/or revert the value of the Sprint field afterwards. But the change will be made, at least temporarily, before the event-based action runs (Jira doesn't support any validation when editing an issue, i.e. outside of a transition screen).

1 vote
Answer accepted
Vamsi Kandala
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 21, 2022

Hi @Umar Maroof

Atlassian still haven't implemented this feature yet despite many users requesting for the same.

There are options using 'ScriptRunner' plugin or using 'Scripted (Groovy) Validator' option if you have 'Jira Misc Workflow Extensions' app installed in case of Data Center or you can use 'Parent Status Validator'.

For this, you should have a separate dedicated workflow for Sub-task.  

If using 'Parent Status Validator', click on the transition link 'Create' connecting the grey circle to the first status in the 'Sub-task' workflow and select 'Validators' option. 

In the 'Validators' screen, click on 'Add validator' and select 'Parent Status Validator'.

It will provide you the list of statuses what the parent ticket status should be.  Choose one or more, or in your case select 'IN PROGRESS'.

In the 'Error message' text box, provide any user-friendly message why the user cannot create the sub-tasks.

Click on 'Add' and publish the workflow.

Hope this helps.

Thanks,
Vamsi

Umar Maroof
Contributor
December 21, 2022

@Vamsi Kandala Thanks for your response 

I am using cloud and I have Jira misc workflow extensions app but I never use this app before so I dont Know how I can put restriction on status through this app. can you please explain me how I can do this with JMWE in cloud.

Vamsi Kandala
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 22, 2022

Hi @Umar Maroof,

The steps are same for Cloud as well.

  • Select the workflow for Sub-task.  
  • Click on pencil icon under 'Actions'
  • Select 'Diagram' option if it is not showing it by default
  • Click on the transition link 'Create' connecting the grey circle to the first status in the 'Sub-task' workflow and select 'Validators' option. 
  • In the 'Validators' screen, click on 'Add validator' and select 'Parent Status Validator'.
  • Click on 'Add'
  • It will provide you the list of statuses of what the parent ticket status should be.  Choose one or more, or in your case select 'IN PROGRESS'.
  • In the 'Error message' text box, provide any user-friendly message why the user cannot create the sub-tasks.
  • Click on 'Publish Draft' and publish the workflow.

Hope this helps.

Thanks,
Vamsi

Umar Maroof
Contributor
December 22, 2022

@Vamsi Kandala  Thankyou so much for your help. 

I have one more question that can we automatically change the status if we add the issue in sprint 

for example if we are in TO DO status and we add the issue into sprint it will automatically transition the issue IN PROGRESS status. I try this by automation but its not working. If you have any solution for this.

Thanks 

Vamsi Kandala
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 22, 2022

Hi @Umar Maroof

Yes, you can do this using automation rules.

  • Select the trigger as 'Field value changed'
  • Select 'Sprint' in the 'Fields to monitor for changes'
  • Select 'Any changes to the field value' in the field 'Change type'
  • Select 'Edit issue' for the field value 'For'
  • Click on 'Save'
  • Click on 'Add new component' and select 'New condition'
  • Select 'Issue fields condition' (this is to check for transition the issue only if there is a value for the 'Sprint' field)
  • Select 'Sprint' in the 'Field' option
  • Select 'is not empty' for the 'Condition' option
  • Select 'New action'
  • Select 'Transition issue'
  • Select 'In Progress' and click on 'Save'

You can add another condition after the 'Issue fields condition' component for 'Sprint' to check the status of the issue and ensure that the status is in 'To Do'.  This way, the automation rule will trigger only when the issue is in 'To Do' status and if the Sprint value is updated.

Hope this helps.

Thanks,
Vamsi

Like • Umar Maroof likes this
Umar Maroof
Contributor
December 22, 2022

@Vamsi Kandala here is the screenshot of rule and audit log see is show the error although this transition "Ready for develpment" is in my workflow for this issue.

Vamsi Kandala
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 22, 2022

Hi @Umar Maroof

Can you please upload the screenshots of both the automation rule and the workflow again?  Also, from which status you are trying to transition to 'Ready for development'?

Note that, there has to be a direct transition link between the source and target statuses.

Thanks,
Vamsi

Umar Maroof
Contributor
December 22, 2022

@Vamsi Kandala Thankyou so much Now its working perfectly!!!!

Vamsi Kandala
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 22, 2022

Hi @Umar Maroof

Good to know that.

Thanks,
Vamsi

Like • Umar Maroof likes this
0 votes
Jack Brickey
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 21, 2022

Not OOTB unfortunately. Something like Scriptrunner or similar could work.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events