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

Kathy Jones October 25, 2017

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

2 votes
Tayyab Bashir
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.
October 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. 

Kathy Jones October 26, 2017

Thanks for the quick response!

Suggest an answer

Log in or Sign up to answer