is there any way to change due dates automatically in several task with different due dates ????
Asked by MURUGESH S:

hi everyone  

i have epic ticket under the epic ticket there are many task tickets linked  

so my question is is there any possible way if we enter duedate in epic ticket automatically update task tickets with deferent due dates ( for each task need saparate due dates while changing te due date in epic ticket)  

please someone help me


Answers:
author: Mark Segall
body: Hi [@MURUGESH S](/t5/user/viewprofilepage/user-id/5201111) - This is definitely possible, but it would help if you provide a little more context. Is your expectation that the due date will be dynamically determined based upon some type of business logic? If so, what is that business logic?

comments: author: MURUGESH S
body: It's not a one time thing or dependent on user input so i need automation for if we enter duedate in epic ticket automatically update task tickets with deferent due dates ( for each task need saparate due dates while changing te due date in epic ticket)


author: MURUGESH S
body: Requirement example   
i have one EPIC under that 4 task issues are linked  

EPIC due date =1-8-2023 if i enter this dude date in epic .the due dates of tasks wil be automatically updated like this   

task1=1-2-2023  

task2= 1-3-2023

task3= 1-1-2023  

task4=1-4-2023  

<br />

Is this possible ????  


author: Mark Segall
body: Yes it's possible, but need to make sure the business logic is repeatable. For example, will task 3 always be 7 days before, task 1 always be 6 days before, task 2, 5 days before, etc?

Automation needs repeatable parameters:

* How does it know what date to set the child issues?
* How does it know the sequence (e.g. How to identify what should be task 1, 2, 3 etc)?


author: MURUGESH S
body: The requirement we needed all tasks underneath the Epic to have their due dates set based on a formula of

(Epic Due Date) - (Months Prior field)


author: Mark Segall
body: Thanks for the clarification. One more question. The months prior field. Is this just a simple numeric field indicating how many months prior? For example:

* Epic Due Date: 31/Dec/23
* Task Months Prior: 5
* Task Due Date: 31/July/23

Is this the expected outcome?


author: MURUGESH S
body: yes exactly this is the requirement


author: MURUGESH S
body: we have lot of tasks under epic   

for each task we have different month prior


author: Mark Segall
body: Thanks for clearing things up. Here's how the rule could look:

* TRIGGER: Field Value Changed (Due Date)
* CONDITION: Issue Type = Epic
* BRANCH: Stories (or Other Issues in Epic)
  * ACTION: Edit Issue (Due Date)
    *

      ```
      {{triggerIssue.dueDate.minusMonths(issue.Months Prior)}}
      ```


author: MURUGESH S
body: custom feild =month prior ( number field ) is this rule works for this ???


author: Mark Segall
body: Yes - If it's a numeric field, this should work.


author: MURUGESH S
body: i have created same rule but it is not working


author: Mark Segall
body: Can you please share a screenshot of the rule audit log? This will help us understand what's failing.


author: MURUGESH S
body: audit log shows it success but in task issue the due date shows empty


author: Mark Segall
body: Hmm... Can you share a screenshot of the rule itself?


author: MURUGESH S
body: ![1.png](https://community.atlassian.com/t5/image/serverpage/image-id/275824i5726B42B0F8AA5E5/image-size/large?v=v2&px=999 "1.png")


author: MURUGESH S
body: ![2.png](https://community.atlassian.com/t5/image/serverpage/image-id/275825iCF1E353A915FA7A5/image-size/large?v=v2&px=999 "2.png")Like this i need result


author: MURUGESH S
body: here is the audit log its show success but it was not edit the due date in tasks![audit.png](https://community.atlassian.com/t5/image/serverpage/image-id/275826i1FA9BEA57176C3F3/image-size/large?v=v2&px=999 "audit.png")


author: Mark Segall
body: Hmm... Everything looks good. Perhaps there's something amiss with the smart value. Can you add a Log Action to your rule just below the Edit Issue Fields with this:  

```
Epic DueDate: {{triggerIssue.dueDate}} ** Months Prior: {{issue.Months Prior}} ** Task DueDate: {{triggerIssue.dueDate.minusMonths(issue.Months Prior)}}
```

Then run it again and let's look at the log. This will give us a sense of what it's picking up/processing.


author: MURUGESH S
body: Awesome its working  

you are Marvelous, Thank ,Thank so much for your help


author: MURUGESH S
body: and i have forget to one more thing same requirement need for weeks prior also   

is this possible ???


author: Mark Segall
body: I'm not sure what changed for you that it's suddenly working. The Log Action was only intended to help provide visibility into what was going on and help us troubleshoot the issue further.

As for Weeks Prior... I need a little more info. Is the intent that the months/weeks prior are to be combined in the calculation? For example...

* Epic Due Date = 31/Dec/23
* Task Months Prior = 1
* Task Weeks Prior = 2

Is the expectation that it would return something like **16/Nov/23**? Or is there an expectation that the Weeks prior would be calculated against a different field?


author: MURUGESH S
body: can i use like this ???  

**Log Action** :Epic DueDate: {{triggerIssue.dueDate}} \*\* Weeks Prior: {{issue.Weeks Prior}} \*\* Task DueDate: {{triggerIssue.dueDate.minusWeeks(issue.Weeks Prior)}}  

* **ACTION** : Edit Issue (Due Date)
  *

    ```
    {{triggerIssue.dueDate.minusWeeks(issue.Weeks Prior)}}
    ```


author: MURUGESH S
body: if we enter in weeks prior then we ignore month prior feild


author: Mark Segall
body: Ahh ok - So I would change up your rule to look like this:

* TRIGGER: Field Value Changed (Due Date)
* CONDITION: Issue Type = Epic
* BRANCH: Stories (or Other Issues in Epic)
  * CONDITION: Weeks Prior IS NOT EMPTY
  * ACTION: Edit Issue (Due Date)
    *

      ```
      {{triggerIssue.dueDate.minusWeeks(issue.Weeks Prior)}}
      ```

* BRANCH: Stories (or Other Issues in Epic)
  * CONDITION: Weeks Prior IS EMPTY
  * CONDITION: Months Prior IS NOT EMPTY
  * ACTION: Edit Issue (Due Date)
    *

      ```
      {{triggerIssue.dueDate.minusMonths(issue.Months Prior)}}
      ```


author: MURUGESH S
body: these conditions are not successful weeks prior not working

<br />

<br />

<br />

<br />

BRANCH: Stories (or Other Issues in Epic)

* CONDITION: Weeks Prior IS EMPTY
* CONDITION: Months Prior IS NOT EMPTY
* ACTION: Edit Issue (Due Date)
  *

    ```
    {{triggerIssue.dueDate.minusMonths(issue.Months Prior)}}
    ```


author: Mark Segall
body: Can you please share screenshots of your updated rule and audit log?


author: MURUGESH S
body: i have remove this condition

* CONDITION: Months Prior IS NOT EMPTY

<br />

<br />

now its working   

Thank you very so much [@Mark Segall](/t5/user/viewprofilepage/user-id/4666637)


author: MURUGESH S
body: ![week and month.png](https://community.atlassian.com/t5/image/serverpage/image-id/275921iA30643EC2B07293F/image-size/large?v=v2&px=999 "week and month.png")


author: Mark Segall
body: The condition assures that it doesn't trip over itself, but if it's working for you that's good for me. ?


author: MURUGESH S
body: Thank you very so much to you