@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?
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
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.