Can I prohibit sub-tasks from being closed if they do not have time entered?

Max Cascone December 18, 2017

I'm trying to squeeze an extra condition into the Done workflow transition. I currently have the condition checking that all Sub-tasks are Done, otherwise a Story can not be closed. I also get the pop-up asking to close a story when all of its sub-tasks are done. (Is there a simple way to disable this?)

I would like to also prevent sub-tasks from being closed if they don't have time entered, but that's not happening with the logic I've got now:

Only allow an issue to move to Done IF:

  • The field Issue Type will have to be equal to value 'Sub-task'. Compared as String.
  • The field Remaining Estimate will have to be equal to value '0'. Compared as Number.

OR 

  • All sub-tasks must have one of the following statuses to allow parent issue transitions: DONE

  • The field Issue Type will have to be not equal to value 'Sub-task'. Compared as String.

1 answer

0 votes
Andy Heinzer
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 2, 2018

I am not certain what type of workflow condition you are trying to use to achieve this.  However, from the information we have here, I am not certain you can create a condition like this with native Jira.   Is this Jira Server or Jira Cloud?   It's possible the Jira Cloud platform might have some other native conditions available that do not exist in the server platform. 

But I found that I was able to create a condition like this, but in my case I had to use the plugin Scriptrunner for Jira in order to do so.  At least I was able to do this in my server instance of Jira when using this plugin.

With this plugin installed, you can create a new workflow condition called 'Script Condition'.  From there you can choose the option to use a JQL condition to prevent this transition in the workflow.  I entered a JQL search query of:

(issuetype=Sub-task AND (remainingEstimate is empty OR remainingEstimate = 0)) OR issuetype!=Sub-task

This way all non-subtasks, and subtasks that have no estimate or no remainingestimate, will still be able to execute this transition.   There might be other ways to implement this same kind of functionality through the use of other 3rd party plugins for Jira, but at least in the server version of Jira, I can't see a way to do this with the native code.   This kind of configuration feels like it will require a 3rd party plugin to create a custom condition like the one I suggest above.

Suggest an answer

Log in or Sign up to answer