Link newly created issues to the issue of the same parent with the latest Due Date

Ronny Birresborn October 7, 2024

Dear community, 
i have set up multiple automations in Jira to make planning with the timeline easier.

One is that the Start Date and Due Date of linked issues (type blocks) is adapted automatically, when the Due Date of the linked issue is changed. This way the timeline is always up to date, even if issues are finished late. 

 

Currently we need to link all issues of a parent by hand to use those automations. Now i am trying to create another automation, which links a newly created issue to the issue with the latest Due Date of the same parent. And I am failing miserably.

It is easy to link an Issue to a specific other Issue by name. But I can´t figure out how i can find the issue with the latest Due Date of the parent.

Another Option would be to find the Issue, which has the same Due Date as its parent, since i always update the parents Due Date with the latest one from the issue. 

I hope you can help me, 
Ronny

 

1 answer

1 accepted

0 votes
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.
October 7, 2024

Hi @Ronny Birresborn -- Welcome to the Atlassian Community!

For a question like this, please post 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. Those will provide context for the community to offer ideas. Thanks!

Until we see those...

A question: what happens if multiple issues meet your criteria, with the same value for the latest Due Date...or is that not possible?

 

Let's assume your rule is triggered on Issue Created, and the new issue had the parent sent when created...and that parent is an Epic.  The rule could use Lookup Issues with JQL to get children for the parent, ordering them by the Due Date, and so allowing getting the latest one.

  • trigger: issue created
  • action: re-fetch issue
  • condition: issue type is Story, Task, Bug...one of your types for the scenario
  • condition: parent field is not empty
  • action: lookup issues, with JQL of
project = yourProject
AND parent = {{triggerIssue.parent.key}}
ORDER BY duedate DESC
  • smart value condition: to confirm that {{lookupIssues.size}} does not equal 0
  • action: link issues, using the key from {{lookupIssues.first.key}}

 

Kind regards,
Bill

Ronny Birresborn October 8, 2024

Hi Bill, 
your idea works perfectly with some minor adjustments. 

The important adjustments were that i needed to exclude issues without a duedate, because they are always the first key with the DESC order.

project = "Projectname" AND parent = {{triggerIssue.parent.key}} AND duedate is not empty ORDER BY duedate DESC

image.png

Thank you a lot, 
this automation finally got us a "real" Gantt Chart experience in Jira, where all dates are updated automatically at all times!

Best regards,
Ronny

Like Bill Sheboy likes this
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.
October 8, 2024

Well done!

And also...I recommend always adding the Re-fetch Issue action immediately after the Issue Created trigger.  That trigger can fire so quickly that the rule may not get all of the issue data yet.  As a result, conditions and field actions may not work as expected.  The re-fetch will slow down the rule a bit and reload the data before proceeding.

Suggest an answer

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

Atlassian Community Events