How to prevent user from moving story to in progress until sub-tasks are created?

I want to create the following workflow but am having trouble finding a way, with the current out-of-the-box options that I am finding when I browse the workflow area:

  • user is able to create a story without sub-tasks
  • however, user is not able to move a story without sub-tasks into a "in progress" state - user must create sub-tasks in order to move a story to "in progress
  • of course this wouldn't apply to, for example, a stand-alone task

1 answer

1 vote
Tayyab Bashir Community Champion Oct 26, 2017

Hi,

You can't do this with default features provided. 
You can look into plugins that can help with this functionality. 
ScriptRunner Plugin can help you achieve this task. 

If you have this plugin, then you can either add a condition or a validator on the workflow transition you want to block until a subtask is created. 

You can use the following code for either Simple Scripted Condition or Simple Scripted Validator

if (issue.issueType.name == "Story"){
if (issue.subTaskObjects.size() > 0){
return true
}
else return false
}
else return true

Difference between the output from condition and the validator.

If you chose to go for the condition, then the Transition Status would not show at all. 
For e.g. If you add condition on Submitted --> In Progress, then the "In Progress" status won't show untill you add the subtask. 

If you chose to go for the validator, then the Transition status would keep showing, but it will throw an error if someone tries to perform that operation, without creating the subtask. 

Thanks for the quick response!

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Julia Dillon
Posted Apr 17, 2018 in Jira

Tell us how your team runs on Jira!

Hey Atlassian Community! Today we are launching a bunch of customer stories about the amazing work teams, like Dropbox and Twilio, are doing with Jira. You can check out the stories here. The thi...

767 views 2 19
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you