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
How to earn badges on the Atlassian Community

How to earn badges on the Atlassian Community

Badges are a great way to show off community activity, whether you’re a newbie or a Champion.

Learn more
Community showcase
Published Sunday in Agility

You asked for it, so we delivered: images on issues have arrived

A picture tells a thousand words. And agility boards have just released their latest feature: cover images on issues – so now your board can tell a story at first glance. Upload attachmen...

171 views 1 10
Read article

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