Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Parent Due date update/refresh when child due date is greater

Praveen Ravichandran March 25, 2025

Hi, My JQL skills are not so good but I need help on creating an automation for:

1. A custom created field called milestone

2. I have linked tasks and sub-milestones using 'a child of' relation to the 'is parent of ' milestone

 

Automation rule:

1. Update 'is parent of'linked issue due date when

2. 'is Child of' linked issue due date is greater than 'isparentof' due date 

AND

'ischildof' due date is maximum among the linked children due dates 

 

 

 

 

 

Capture.PNG

1 answer

1 vote
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.
March 25, 2025

Hi @Praveen Ravichandran -- Welcome to the Atlassian Community!

First thing, I recommend not using the Multiple Issue Events trigger for this scenario.  There are recent defects where the rule could run multiple times for the same change.  Instead, create at least two different rules with different triggers: Issue Created and Field Value Changed for your specific field.

 

Next, changing the trigger will help with a different problem: your current rule would run for every issue change, but it should only run when the specific date field changes.

 

Next, you are using issue links for the relationships between the issues, and then trying to find the maximum date for the "child" issues.  Branching to check each linked issue could create timing / update problems.

Instead, I recommend identifying the "parent" issue to update with JQL, and then branching to just that issue.  Then use the Lookup Issues action with JQL to find the "child" issues.  With that, the maximum date value can be easily found to perform a single update of the "parent".

 

Finally, scenarios to sync a field between "parent" and "child" issues have lots of possible cases.  Please consider which cases you want to handle as that will help decide how many rules are needed.  You have have only noted a couple of cases.  Here are some of the other ones:

  1. When an issue is created that has a linked "parent", check if the parent should be updated for the date field
  2. When an existing issue's date field is updated...
  3. When an existing issue is added to a linked "parent"...
  4. When an existing issue is removed from a linked "parent", update the previous parent
  5. When an existing issue changes to a new linked "parent", update the new and previous parents.  This case probably cannot happen for your scenario as both links cannot be changed at one time.
  6. When an existing issue is deleted, update the previous parent
  7. When someone manually changes the date in the "parent", recalculate the correct date from the "child" issues
  8. etc.

 

Kind regards,
Bill

Praveen Ravichandran March 26, 2025

Hi Bill, thanks for your answer

1. Can you give me a rule snapshot in response to mine with the corrections you suggest?

2. JIRA has limitations on hierarchies that can be established. eg: custom field Milestone only has an option to add subtask where I would like to add a sub-milestone and I can only achieve this through links. another example is epics that have subtasks that can be reused to other epics, I do them through linking them by 'is parent of' or 'is child of' relationships 

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.
March 26, 2025

I made suggestions for 1-to-many possible rules, and so...

Using your current rule, I recommend disabling that one, copying it, and then using the ideas I suggested to create one single rule with the new trigger (e.g., for issue created).

Before doing that, perhaps use an example issue to create the JQL needed to identify both the "parent" and "child" issues.  This will make using the Lookup Issues action and the Branch on JQL easier to implement.

Praveen Ravichandran March 26, 2025

Sure, I will look into the example and create one using the existing rule.

Is it possible for you to share one of the possibilities/basic of the rule so I can get an idea. 

 

 

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.
March 27, 2025

Certainly!  The "created" scenario will be similar to your current rule:

  • trigger: issue created
  • action: re-fetch issue (I recommend always adding this action after the issue created trigger to prevent timing / racetrack errors.)
  • related issues condition: check if there are linked issues present that is a parent; please confirm the link direction is correct for your scenario
  • branch: on JQL to the issue linked to this one which is of the correct link type... issue IN linkedIssues("{{triggerIssue.key}}", "is parent of")
    • action: lookup issues with JQL to find the linked issues which are "is child of" the parent... issue IN linkedIssues("{{issue.key}}", "is child of")
    • smart values condition: check if any issues where found
      • first value: {{lookupIssues.size}}
      • condition: greater than
      • second value: 0
    • action: edit issue
      • use the {{lookupIssues.duedate.max}} to update the parent's field

 

Please review the JQL used and the link names to confirm that match your configuration.  Those could be tested standalone with example issues to confirm they work as expected, and then use the JQL in the rule.

 

Praveen Ravichandran April 1, 2025

Thanks a lot Bill!

I applied this rule but this doesnt work as per the audit log I have attached. Can you let me know why this could be the case?

Capture.PNG 

 

Praveen Ravichandran April 1, 2025

Attached copy of the ruleCapture.PNG

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.
April 1, 2025

Reviewing the branch shown, it does not match what I suggested (using JQL), and it is not returning any issues (as shown by the audit log).

Please update the branch as needed to branch to the correct "parent" linked issues and then re-test.

Suggest an answer

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

Atlassian Community Events