How to create an automation to close Parent service request when all clones(childrens) are closed?

Dmytro Novitnii
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 15, 2024

Hi everyone!

 

I need to create an automation for HR department based on the following task:

"We request that once the last cloned “children” ticket is closed, the “parent” ticket be automatically closed in JIRA"

photo_2024-03-15_17-19-16.jpg

I tried to use the standard script to close the main task when all the subtasks are closed, but it doesn't work in this case. Also here is the workflow for this project. I added a transition from "Hr validation" to Closed to make the automation work in this case. As a condition, he indicated that the transition to closed can only be as indicated on the screen.photo_2024-03-15_17-19-57.jpgphoto_2024-03-15_17-32-21.jpg
Can you please help with what needs to be fixed or redone?

 

2 answers

1 accepted

0 votes
Answer accepted
Ste Wright
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 16, 2024

Hi @Dmytro Novitnii 

Why only cloned tasks? Can't you just close the Parent once all the children are closed?

Or is this not a parent/child relationship, and the issues are just linked (i.e sibling relationship)? If this is the case which direction is the "parent" issue in, clones or is cloned by?

---

If it's the latter, and...

  • The "parent" is the issue which was cloned, multiple times
  • The "children" are the clones
  • The children are Service Requests (as it's the child which triggers the issue)

...the rule might look like this:

  • Trigger: Issue Transitioned
    • To Status = Closed
  • Condition: Issue Fields Condition
    • Field = Issue Type
    • Condition = equals
    • Value = Service Request
  • Branch: Related Issues
    • Type = Linked Issues
    • Link Types = clones
      • Branch-Condition: Related Issues Condition
        • Related Issues = Linked Issues
        • Link Types = is cloned by
        • Condition = All match specified JQL
        • JQL - status = Closed
      • Branch-Action: Transition Issue
        • Destination Status = Closed

Ste

Dmytro Novitnii
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
March 26, 2024

Hi Stephen! 

Sorry for such a late reply, and late me thank you!

 

It works now!

Like Ste Wright likes this
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.
March 15, 2024

Hi @Dmytro Novitnii welcome to the community!  Have you looked in the Automation Templates for Jira? When you're in Jira, looking at the Automations from inside your Project Settings of your Jira project, there's a template called 'When all child issues are completed, then close the parent' under the Software section.  (first column, third one down on my list).  I don't know if you used this to start your automation, but it might be worth looking at.

Hope that helps.

Suggest an answer

Log in or Sign up to answer