Forums

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

Prevent partent issue from being closed when subtasks are open

Michael Arndt
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.
August 13, 2019

@Oliver Siebenmarck _Polymetis Apps_  This is directed at you since I think your app can solve this.

How can I prevent a parent issue status from being changed to DONE if there's open subtasks? 

Bonus question. Can it display a warning/error message that tells the user why they can't close the issue?

1 answer

1 accepted

3 votes
Answer accepted
Oliver Siebenmarck _Polymetis Apps_
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.
August 14, 2019

Hi Michael,

There are multiple ways to do this. Jira does include a condition called "Sub-Task Blocking Condition" which can block a transition if subtasks are in a certain state. However, I personally find it a bit cumbersome to use and also would rather have it as a Validator. (The difference being that a condition hides the transition while the validator gives you the option to try and then shows an error message.)

Of course, you can also do this with Cloud Workflows with the following expression:

issue.subtasks.filter(s => s.status.category.name != 'Done').length == 0

You just would to change the 'Done' above to whatever status you require the subtasks to be in. In most cases though, 'Done' should be just fine.

The Cloud Workflows approach can be used either as a condition or a validator and gives you a bit more flexibility to add further constraints.

As for the custom error message: Unfortunately, that isn't possible with right now. The "Sub-Task Blocking Condition" in Jira doesn't have an error message and currently we cannot add a custom error message when setting a validator. However, with the Cloud Workflows approach and using a validator, a user would at least get an error message, albeit a very general 'custom validator failed' one.

Hope that helps,

 Oliver

Michael Arndt
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.
August 14, 2019

Thanks for the thorough answer Oliver. I actually discovered the Subtask Blocking Condition after i made my post. I'll probably just keep this basic.

Like # people like this

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events