How to update the parent issue from the linked child

Andre de Castro
Contributor
December 9, 2024

I need to update the parent status field based on the last updated child, using automation for Jira

1 answer

1 accepted

1 vote
Answer accepted
Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 9, 2024

Hi @Andre de Castro 

What have you tried thus far to solve this need?

 

If you have a rule and it is not working as expected, context is important for the community to help.  Please post the following:

  • what type of project is this (e.g., company-managed, team-managed, etc.), 
  • an image of your complete automation rule,
  • images of any relevant actions / conditions / branches,
  • an image of the audit log details showing the rule execution, and
  • explain what is not working as expected.

 

If you have not started a rule, I encourage you to try to do so.  The Atlassian Community is a place for people to learn and collaborate with each other.  It is not a free labor pool to implement requests upon demand.  If you frequently need help creating automation rules, I recommend contacting your Jira Site Admin for support.

To get you started on creating your rule, please refer to these documentation and example sources:

 

Kind regards,
Bill

Andre de Castro
Contributor
December 13, 2024

Hello, Bill.
I'll rephrase my question.
I need to create an automation in Jira to update the status of a parent issue with the status of the linked issue that has not had its status updated for the longest time.
I'm having trouble adding an action that determines which linked issue is the one that hasn't been updated for the longest time and how to use that status to update the parent link.

foto1.png

Thanks

 

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 13, 2024

First, I will try to answer your question, and then try to clarify a bit...

 

The statusCategoryChangeDate only gets updated when the Status Category changes, and not necessarily for each change of the Status.  Thus when you have multiple Status values with a Category value of "In Progress", that date may not be what you want.

If you truly want the issue with the earliest statusCategoryChangeDate for a set of issues, I recommend using the Lookup Issues action with JQL to find it.  For example, the JQL could be:

project = myProject
AND statusCategory = "In Progress"
ORDER BY statusCategoryChangedDate ASC

And so the issue with the earliest date would be {{lookupIssues.first.key}} and its Status value would be {{lookupIssues.first.status}}

 

What problem are you trying to solve?  That is, "why do this?"

Perhaps you are trying align the parent Status with the child issues somehow, such as:

GIVEN a parent issue has child issues
AND the parent issue is in the "To Do" status
WHEN the first child issue transitions to "In Progress"
THEN transition the parent issue to "In Progress"

Andre de Castro
Contributor
December 16, 2024

In the organization of our demands, a parent issue can have several child issues. In our worflow, we use several different statuses in the “In Progress” category. I need to keep the parent issue with the same status as the child issue that hasn't had its status updated for the longest time.

Now
Parent (status C)
child1 (status D)
child2 (status E)
child3 (status G)
child4 (status C)

After
Parent (status D)
child1 (status D)
child2 (status K)
child3 (status H)
child4 (status J)

I can't get the status of the child issue that has had the status the longest without being updated.

Thanks

Bill Sheboy
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 17, 2024

I recommend inverting this to update the parent when children transition:

  • When the first child issue transitions to an "In Progress" status category, update the parent.
  • And the likely follow-up rule would be when the last child issue transitions to a "Done" status category, update the parent.

 

This approach will be easier than the alternative:

  • find the earliest value of statusCategoryChangedDate for child issues with as status in a category of "In Progress"
  • use a JQL search to find that child issue
  • use the Status from that child issue to decide how to update the parent

 

Suggest an answer

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

Atlassian Community Events