How do I automatically trigger a status change on a parent issue based on the status of its children's statuses when a child's status is updated?

Andreas Knecht Community Champion Jan 23, 2017

We are trying to automate our workflow. Here is what we would like to do:

We want to change the status of a parent issue (a story) when the status of one of its children changes. For example, suppose I have a story on the backlog that has 5 children that are also on the backlog. As soon as one of those children transitions from the backlog to an "in progress" state, I'd like to update the status of the story to have the status of "in progress" as well. The story would then stay in a status of "in progress" until its last child not yet in the state of "done" moves into a state of "done". At that time the story would be moved to a status of "done". We'd like to do this in an automated way so we never have to actually change the statuses of our stories.

Is this possible with your plugin? If we we'd love to know how to accomplish this. I can see how I would auto transition all subtasks from a change on the story, but not the other way around like we need it. There are lots of people trying to do the same thing online and there is really not a simple way to do it other than scripting it yourself. I am hoping Automation for JIRA can make this a bit easier.

3 answers

1 accepted

Accepted Answer
2 votes

You can certainly do this with Automation for JIRA.  The rule is a little complex, but here's an example:

status-parent-sync.png

So lets break this down:

  • First we execute this rule whenever an issue is being transitioned
  • Next we check using a compare condition that the issue is a 'Sub-task'. We could have also used a JQL condition, but compare is a little faster to execute
  • The we branch of for the parent using the 'related issues' action
    • We now check with a 'Related issues condition' that some sub-tasks are "In Progress"
    • We also check with a compare condition that the parent issue is not currently "In Progress"
    • If those are true, then we transition the parent issue to "In Progress"
  • We have another branch point for the parent using the 'related issues' action
    • We check this time if all sub-tasks are "Done" using the 'Related issues condition'
    • If that's true, then we transition the parent to "Done"

The 2 'related issues' condition inside the two branch points, basically make sure the two branches are mutually exclusive and only one will ever execute.  Hope this makes sense!

 

@Andreas KnechtLove to hear if it is possible to make this on a set of those some sub-tasks and not all of them.

Also @Andreas Knecht what is the "Parent" condition? Works only for Subtask?

Any other "Parent" relation on Jira? 

Andreas Knecht Community Champion Oct 05, 2017

Hi Sebastian,

Yeah so you could definitely restrict this further using the JQL condition and/or related issues condition to only run this rule when certain types of sub-tasks are transitioned.

The 'Parent' condition is actually an our 'Branch / Related issues' action.  It's a way to fork rule execution for related issues of the trigger issue.

There's an number of different options available to find related issues:

  • Current issue
  • Sub-tasks
  • Stories (or other issues in Epic)
  • Linked issues
  • All created issues
  • Most recently created issue
  • JQL
  • Epic (parent)
  • Parent

(these are all in relation to the trigger issue)

So in other words, you can find the 'Linked issues' of a trigger issue, or you could find the Epic of the trigger issue etc.

Hope that helps!

Cheers,
Andreas

Thanks @Andreas Knecht.

You know what the "parent" option for related issues stands for?

@Andreas Knecht can´t make it work to transition Epic status based on Epic's linked issues status.

Any help is much appreciated.

 Captura de pantalla 2017-10-13 a la(s) 14.07.55.png

@Andreas Knecht any news on my question above?

Epics I want to transition are on "Operation" projects only.

Linked issues can be of any type (bug, task, story, incidents and subtasks) and from different projects "Web Crawling" and "Application" with same workflows statuses.

I have Global rule config and all are on create screen already.

I tried with this other rule not on an Epic but on any Task, Story, Incident or Bug to transition from one status to another depending on his linked issues statuses, but is not working.

I branch out for elseif conditions the "For Current Issue" to apply on different status for his linked issues.  

Captura de pantalla 2017-10-16 a la(s) 14.07.20.png

 

Thanks

Andreas, how do you implement the same solution in the Cloud version of Jira?

Interested as well...

does not work 

@Andreas Knecht - I tried this, but it does not work on the Jira Cloud version. Please advise.

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Oct 11, 2018 in Marketplace Apps

You + one app + a desert island...

Hi all! My name is Miles and I work on the Marketplace team. We’re looking for better ways to recommend and suggest apps that are truly crowd favorites, so of course we wanted to poll the Community. ...

3,672 views 6 6
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you