Hi,
There seems to be build in workflow condition for this for 'sub-tasks' but our hierarchy is:
Ideally I'd like a solution for checking each child issue type(s) to be 'closed' / 'done', before the parent issue can be closed.
Any examples would be gratefully received, including using ScriptRunner.
Thanks,
Simon
Hi,
one way to achieve this is to use the "Linked Issues Status" Condition of the JMWE for Jira Server app. Only the Initiative to Epic constraint won't work, because Jira Portfolio doesn't use issue links for that. For that, you'll need a Scripted (Groovy) Validator with a short Groovy script:
!!jqlSearch( "\"Parent Link\" = ${issue.key} and status not in (Closed,Done)", 1 )
where you'll replace Close and Done with the statuses the child issues (e.g. High-level Epics of the Initiative) must be in.
Thanks for the reply David.
I was thinking there would probably be a solution with a plugin, but I was hoping there would be something 'out of the box'.
Regards,
Simon
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi David. I have a similar problem. In my case, we have "Feature" as the Parent (Parent Link) of an Epic. I want to prevent the Feature from moving to the In Progress status unless at least one of it's children is in the 'In Progress' status. How would the groovy script be crafted for that?
I also need to prevent the Feature from being able to transition to Complete unless all of its children are in either a Done or Deleted status. I applied your script above in a "Scripted (Groovy) Condition (JMWE add-on) Condition" on the transition to Complete for the Feature. When I tested it, it didn't work. The transition was allowed when it should not have been. I'm sure the answer is obvious to someone who knows anything about groovy scripting, but that's not me. Since I'm using a condition vs a validator should I have used "in" vs "not in"? I'd greatly appreciate your help. Thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
To prevent the Feature from moving to the In Progress status unless at least one of its children is in the 'In Progress' status, this script should work:
!!jqlSearch( "\"Parent Link\" = ${issue.key} and status in (\"In Progress\")", 1 )
To prevent the Feature from being able to transition to Complete unless all of its children are in either a Done or Deleted status:
!jqlSearch( "\"Parent Link\" = ${issue.key} and status not in (Deleted,Done)", 1 )
which checks that no child issue is in any status other than Done or Deleted.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi David. Sorry to be taking so long to respond but I was on vacation. I just wanted to thank you for you help. The code you provided worked perfectly! I don't know how anyone could get by without the JMWE Add-on.
Thanks!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @David Fischer ,
Thanks for the response, sounds like your plugin does what we need, albeit with a little bit of scripting.
Can you confirm what licence tier we'd have to purchase at please? We currently have 2,000 JIRA server licence, although only about 500 are used, would we have to match that? I'm not sure there would be sufficient benefit for the functionality to warrant $2K per annum.
Regards
Simon
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Simon,
licensing for JMWE works the same way as for any Jira app sold on the Atlassian Marketplace: the license tier must match that of Jira itself.
I understand that purchasing JMWE for a single feature might be overkill. However, I believe JMWE actually has much more to offer so you might want to read a little about its other features.
Regards,
David
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
David,
Is there a way to do this with JMWE in JIRA Cloud?
Jeanne
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Unfortunately not, because Jira Cloud doesn't support custom Validators added by apps (except for completely static ones).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi all, I've managed to implement the following use cases in JMWE for Cloud:
1) Trigger "Transition on Linked Issues" to automatically put the Parent "In Progress" when the first child goes to "In Progress".
2) Trigger "Transition on Linked Issues" to check if all the children are "Done" so that we can move the Parent to Done too automatically.
By applying these rules to the entire hierarchy we are using Initiative->Feature->Epic->Story->Subtask, we are somehow assuring that the Parent only goes to In Progress when the first child goes to and gets Closed only when all the children get Closed too. (this scenario you can actually achieve through a validator too).
Please reach out if you need further help on this type of issues.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
JMWE Cloud now offers conditions and validators. So you might want to try them to simplify your workflow.
Regards,
Radhika
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks @Radhika Vijji _Innovalog_ for your feedback.
So, can you give a concrete example of how would that look like if I want to validate:
1) That at least one child issue is in progress while trying to move the parent.
2) That all children are closed before being able to close the parent.
I kindly ask you to be specific about the options / scripts used for the purpose.
Thanks,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@[deleted] @Radhika Vijji _Innovalog_ Do we have any option to restrict the closure of Capability using the JMWE validator / any script validator
We are looking to close the Capability only when all epics are closed . We use JIRA cloud
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I assume Capability is an issue type above Epics in your Advanced Roadmap hierarchy? If so, there's unfortunately no way at this time to access the hierarchy from Jira Expressions, which is the only way to write Validators in Jira Cloud. This is a Jira Cloud limitation: https://ecosystem.atlassian.net/browse/ACJIRA-1766
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
i get this error when i try to use the groovy code above:
{ 2 "timestamp": "2023-03-10T10:36:12.827Z", 3 "webhookEvent": "jira_expression_evaluation_failed", 4 "expression": "!!jqlSearch( \"\\\"Parent Link\\\" = PDM-1784 and status not in (Done)\", 1 )", 5 "errorMessages": [ 6 "Evaluation failed: \"jqlSearch\" - identifier not available in context" 7 ],
Validator:
!jqlSearch( "\"Parent Link\" = ${issue.key} and status not in (Done)", 1 )
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The code shared above is for Jira server/DC. On Jira Cloud you're limited to Atlassian's Jira Expressions language which does not support running JQL searches. See https://community.atlassian.com/t5/Marketplace-Apps-Integrations/Re-Re-Validate-Child-Issues-are-Closed-before-Parent-Is/qaq-p/2035265/comment-id/94382#M94382
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.