Forums

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

When an Epic's due date changes, apply the difference in business days to children's due dates

mliesik_tpci
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 22, 2025

When an existing Epic's due date changes I want to calculate the difference in business days between the old value and the new value, and then apply that difference, also in business days, to the due date of each child ticket. Most of the child tickets will have a due date that can be anywhere from 1 to 60 days prior to the Epic's due date, so if the Epic's due date changes it can be a pain to manually recalculate the new due date for each of its child tickets. 

I've been able to accomplish the first part using 3 sequential variable actions to get the Epic's old due date value, new due date value, and diff in business days. However, when I try to modify the child tickets' due date using the output from the 3rd variable as the number of business days the end result is that each child's due date field gets cleared.

Here's an example of the rule I've got built as a proof of concept. It intentionally assumes that the Epic's new due date will always be greater than its old due date to make for easier troubleshooting:

 

When: value changes for Due date

If: issue type = Epic

Then: create variable

  • variable name: varEpicOldDueDate
  • smart value: {{#changelog.duedate}}{{fromString}}{{/}}

And: create variable

  • variable name: varEpicNewDueDate
  • smart value: {{issue.duedate}}

And: create variable

  • variable name: varEpicDueDateDiff
  • smart value: {{varEpicOldDueDate.toDate.diff(varEpicNewDueDate.toDate).businessDays}}

Branch: for children

  • If: Due date is not empty
  • Then: edit work item fields
    • Due date: {{issue.duedate.plusBusinessDays(varEpicDueDateDiff)}}

Jira Automation_Update Due Date for Children of Epic.png

1 answer

1 accepted

4 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.
July 22, 2025

Hi @mliesik_tpci -- Welcome to the Atlassian Community!

Created variables are text, as you saw when converting some of your values with toDate.

To use your varEpicDueDateDiff as parameter for the function, please use the asNumber function:

{{issue.duedate.plusBusinessDays(varEpicDueDateDiff.asNumber)}}

 

To learn more about using variables as numbers in various situations, please see this article I wrote on the topic:

https://community.atlassian.com/forums/Automation-articles/Automation-concepts-Using-Created-Variables-as-Numbers/ba-p/2953116

 

Kind regards,
Bill

mliesik_tpci
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 22, 2025

@Bill Sheboy that did the trick! Thanks tons! :)

Like # people like this

Suggest an answer

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

Atlassian Community Events