Automation to close parent ticket when all child tickets are closed

Alon Yehezkel November 20, 2024

I have a Jira ticket - a parent.
And a few linked issues from several projects for the same parent.
How can I close the parent if ALL the linked issues are closed?
I was able to do it if only 1 ticket was linked to the parent, but when I have several I get stuck. 
Thanks!

2 answers

0 votes
Dan Breyen
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 20, 2024

Hi @Alon Yehezkel Atlassian provides some Automation Templates that you can use.  I found this one specific to closing the parent when the children are resolved that is probably pretty close to what you're trying to do. 

Check it out here.  From inside the application, when you're looking at your automations, there should be a Templates tab that will take you to the predefined templates.  I've used several of those in my instance and then tweaked them to fit my application.

Hope that helps.

0 votes
Thorsten Letschert _Decadis AG_
Atlassian Partner
November 20, 2024

Hey @Alon Yehezkel ,

Welcome to the Atlassian Community!

Could you please share some additional information that might help suggest the best answer?

  • You're explicitly stating that this question is related to a parent. Are sub-tasks involved? If so, is the status of those sub-tasks also affecting the mechanism you're trying to implement?
  • Can you share the automation that you've implemented and that is working for your "only 1 ticket linked" scenario?

From what you've provided, I'd assume that you need the following high-level approach:

  • Since you're referring to "several projects", you'll probably need a global automation rule that's at least running for all the projects involved.
  • The trigger might then listen for "ticket closing", which could be read via status or resolution.
  • You'd then have to a) check for the existence of your "linked parent", as well as b) check for the status/resolution of all linked issues in place for your "linked parent" (including the one that triggered the rule).
  • If all of those qualify as "closed" (again: status? resolution?), you'd want to transition the "parent" to closed as well.

I hope that's helpful! Looking forward to hearing from you!

Cheers,
Thorsten

Alon Yehezkel November 20, 2024

Hi @Thorsten Letschert _Decadis AG_ 
Thank you for your help.
This is the automation currently working with 1 linked issue:

Screenshot 2024-11-20 105813.png

and this is example the use case I want to solve, in the picture below, when these 2 linked issues are in status "done" I need to change the status to "done" also the main task (BIP).
image.png

Thorsten Letschert _Decadis AG_
Atlassian Partner
November 20, 2024

Hi @Alon Yehezkel

I'd suggest the following approach:

Automation to close parent ticket when all child tickets are closed.png

  1. Adjust to your initial query, e.g., check for the issue type "T3_Bug" so that the rule only advances for your issues of interest. In your scenario, that might pass for ONB-152.
  2. You're already correctly switching within the branch to the linked issues. In your scenario, that would make the switch towards BIP-1360.
  3. Verify that all issues linked to this issue (here BIP-1360) are "Done".

I would generally recommend making all conditions and also the linked issues branch query as precise as possible to avoid producing false positives, e.g. by including the link type to the branching component, if this should only apply for blocking issues etc.

Please let me know if that solves your request.

Cheers,
Thorsten

Thorsten Letschert _Decadis AG_
Atlassian Partner
November 20, 2024

Additional hint: You might want to consider limiting the scope of the rule to "Multiple projects" and only selecting the "triggering" projects of interest to avoid unnecessary executions with regard to automation limits.

Alon Yehezkel November 21, 2024

@Thorsten Letschert _Decadis AG_ Thank you!

Unfortunately I tried this with and without the last linked issue condition - both are didn't work.
The main problem is when I tried to switch to the BIP, I can't reach to it.
Meaning I can only "see" it from the T3 bug as linked issue.
I need to actually to make my conditions on the BIP.
Because T3 will have only 1 linked issue (BIP) while the BIP will have several T3 linked issues 



image.png





Thorsten Letschert _Decadis AG_
Atlassian Partner
November 21, 2024

Hi @Alon Yehezkel , 

If I understand your requirement correctly, this should work, removing your first "Linked issues match" condition. In your screenshot, there's an AND between the two, and an issue can't be of type "task" AND type "T3_Bug" simultaneously. 

Within the branch, assuming your BIP ticket is returned within the "For: Linked issues" component, the components within the tree change "perspective" and the "Linked issues" condition is run against your BIP ticket.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
TAGS
AUG Leaders

Atlassian Community Events