How to add days to the parent's due date?

Roger Alexis Mosquera Montaño January 8, 2024

Hi

When the due date of a subtask is modified, I need to identify the number of days of difference between the original due date and the final due date, and then add that number of days to the due date of the parent.


How can I get it through automation?

Could you give me an example?

 

Thank you.

1 answer

1 accepted

0 votes
Answer accepted
Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 8, 2024

Hello @Roger Alexis Mosquera Montaño 

Welcome to the Atlassian community.

Are you working with Jira Cloud or Jira Server/Data Center?

If the URL is similar to https://something.atlassian.net then you are probably working with Jira Cloud. Alternately you can check the bottom of a Dashboard screen to see if there is Jira application version information displayed. If there is, then you are working with Jira Server or Data Center, and we need to know which version you are using.

Roger Alexis Mosquera Montaño January 9, 2024

Hi Trudy

I'm working with Jira Cloud.

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 18, 2024

Hello @Roger Alexis Mosquera Montaño 

To find the difference between two dates use the diff function:

https://support.atlassian.com/cloud-automation/docs/jira-smart-values-date-and-time/#Date-difference---

To add a value to an existing date field, use the plus function:

https://support.atlassian.com/cloud-automation/docs/jira-smart-values-date-and-time/#Date-plus-unit---

I haven't worked out all the details but the basic structure of the rule would be:

Trigger: Field Value Change
Field: Due date

Condition: Issue Field Condition
Field: Issue Type
condition: equals
Value: <pick the value for subtask>
Condition: Issue Field Condition
Field: Due date
condition: is not empty
Condition: Smart Values Condition
First Value: {{fieldChange.fromString.IsNotEmpty()}}
condition: equals
Second value: true

Action: Create Variable
<step to calculate the difference between the original and new Due date>

Branch: For Related Issue: Parent
Condition: Issue Field Condition
Field: Due date
condition: is not empty
Action: Edit issue
Field to edit: Due Date
Value: {{issue.duedate.plusBusinessDays(<variable name from Create Variable step>)}}
Roger Alexis Mosquera Montaño April 3, 2024

Hi Trudy

Thank you so much

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 3, 2024

You're welcome, @Roger Alexis Mosquera Montaño 

If my response helped you solve your need, please consider clicking on the Accept Answer button. That will mark your Question as Solved, and help others searching for answers find the posts with validated solutions.

Suggest an answer

Log in or Sign up to answer