Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Automation: When all linked issues are done how do I move parent issue to done

Greg March 24, 2021

I have a HR Service Desk project that uses automation rules to create Tasks within the IT Service Desk when a new employee is requested. For example, to procure a new laptop or create a new user account.

I am trying to use automation to transition the parent (HR) issue to Done once all the linked issues are marked as Done. Unfortunately, I simply cannot figure out how to do this.

Within the Automation Library, there is an automation called "When all sub-tasks are done → move parent to done". I have attempted to edit that however I haven't had any luck at all.

Any help is appreciated.

 

5 answers

1 vote
John
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
March 28, 2021

Hi @Greg 

You'll need to create your rule in Global automation which requires Jira Admin permission. Navigate to automation by going to Settings cog / System / Global automation (it's at the bottom of the sidebar).

When you are creating your rule click the rule details (at the top of the rule summary) and update the scope to be multiple projects. You can then select the projects where the rule needs to run (HR Service Desk and IT Service Desk).

Then your rule might look something like this

Screen Shot 2021-03-29 at 3.40.52 pm.png

  • The trigger runs the rule whenever an issue is transitioned to done (in the projects you select in the rule details)
    • Please note that every time this rule runs it counts towards your monthly limits, so even if it doesn't transition the linked issue to done it will count (because the rule had to run to learn that it wasn't ready to be transitioned).
  • Using a branch looking at linked issues (you can select a relationship type here to make your rule better, if your issues are always linked as "relates to" then I'd recommend using that)
  • The issue field condition then checks if the related issues is in a specific project (this would be your HR service desk project)
  • If the issue is in that project then a related issue condition checks that all the linked issues match the JQL status = done
  • If all the linked issues match that status then the issue is transitioned to done

I had a quick test and it worked for me. If you can add more precise conditions it will ensure your rule only performs actions on the correct issues.

Thanks,

John

Greg May 11, 2021

Thanks John! The way the rule is structured makes sense.

However, based on the fact that the rule has to run each time an issue is transitioned to Done just makes it impracticable in my environment. I would reach my limit in no time at all.

Is there no way to add a condition that takes into account the type of issue it is (in my case a Task that relates to the parent) to determine if the rule should run?

Thank you again.

Sara Ribes October 5, 2021

Hey Greg,

I'm trying a similar Automation for my project, I was wondering if you have solved this issue.

Thanks!

Sara

Greg October 5, 2021

Hi Sara,

The answer that John provided (Mar 28) was the closest I could get to actually having it work the way I wanted. However, because the rule would need to be run at such a high rate and we would reach our monthly Automation limit in no time, there was no way I could implement it in my environment.

In our current workflow, the parent requests are manually marked as Done when all related Tasks are complete. Actually, I should say that they are supposed to be manually marked as Done... ;)

-Greg

John
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
October 5, 2021

Oops sorry I've missed a reply here!

The only alternative I can think of is using a schedule trigger instead of issue transitioned. But this would mean the updates don't happen in real time. 

This will give you more predictability in your usage and can perform the transitions in bulk at a specified time (e.g. twice a day, at the end of the day, at the end of the week, etc...). You'll just need to make sure you check "run a JQL search and execute actions for each issue in the query".

Here is a reference of how it might look (but you'll need to figure out the JQL that's correct for your situation).

Screen Shot 2021-10-06 at 10.08.38 am.png

Thanks,

John

Jay Keck May 19, 2022

I'm trying to accomplish this as well, where when all linked tasks of a given ticket are closed that I close then I close the ticket. But, when I try the rule suggested above it's really transitioning the linked tasks since the transition node is in the Linked issues branch of the rule. How can I get the transition node to refer to the original ticket? This workflow is being triggered each time a linked issue is transitioned to Done by another rule that updates a field in the issue the newly closed was linked to, and then i put a couple of filters since I only want ticket to be transitioned if it is in the In Progress state. For my testing all issues are in the same project, so I haven't made it global yet.

Thanks!

Screen Shot 2022-05-19 at 11.39.14 AM.png

1 vote
Brant Schroeder
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 24, 2021

@Greg 

If you want to share screenshots you can and I can help you move through it.  There is also an example of how you can do it here: https://community.atlassian.com/t5/Automation-questions/How-can-I-transition-the-parent-when-all-subtasks-are-resolved/qaq-p/159407

Greg March 25, 2021

Hi Brant,

Thank you so much for the offer to help. At this point I've been trying so many different things that I have no idea what will work anymore.

I took the example from the link you provided, but it doesn't seem to do the trick. I'm sure I've made some mistake somewhere in the configuration.

Below is a screenshot of the automation as it stands now (not working).
Also is a grab of a sample ticket to give you an idea of what I'm aiming to do:
Once all of the Tasks linked to the Request have been set to "Done" I'd like the Request to be transitioned to "Done" as well.

Thanks again.

linkedTaskAutomation.jpgtransitionExample.jpg

Brant Schroeder
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 29, 2021

I was out last week, John's answer below should work let us know if you have any issues.

0 votes
Tâm_ Nguyễn Thanh April 5, 2023

Hi Greg,

I tried this and It worked: the scope of the rule should be "Multiple projects" and include all projects whose issues are linked

Capture4.PNG

Tâm_ Nguyễn Thanh April 5, 2023

I found that this rule also has the reverse effect:

Project A - Task 01 has bellow linked issues:

    + Project B - Task X

    + Project B - Task Y

 

as we expected, when Project B Task X and Task Y move to DONE then Task 01 of Project A will be DONE, but if we move Task 01 of project A to DONE it also makes Task X and Task Y move to DONE

:-(

0 votes
Shrikant February 18, 2022

@John 

Hi John,

I also have the similar requirement that when all the linked issues are resolved the parent issue should be resolved.

I tired what you suggested but the problem is it is not checking for all the linked issues even if one of the linked issue is resolved the automation rule triggers and resolves the parent issue.

Could you please let me know how to check for all the linked issues and not just the one ?

 

pfa image for my automation rule.automation rule.JPG

Annamalai, Krishnapriya May 16, 2023

@Shrikant  Did you get a solution for this . Im having a same case where , i need a specific issue to be closed , once all the linked issues move to Done category . 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events