Forums

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

Help changing subtask Start Date and Due Date fields

Justin Baker
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!
October 24, 2022

Hi, I have a project which is designed to have a parent issue ticket and as the project is moved between statuses, different sub-tasks are created with a start/due date based on business days from the parent due date.  This I have working fine, but I am trying to write an automation that will adjust open sub-task dates if the parent due date is changed.

My automation detects the due date change from the parent and calculates the new number of business days to change and inserts it into a Smart Value (DaysToShift), this is working from viewing logging:

{{fieldChange.from.toDate.diff(fieldChange.to.toDate).BusinessDays}}

I then have a rule which I am trying to update the Start Date and Due Date fields for any open subtasks.  I have tried these values but I keep getting an error.

Start Date Value: {{issue.[Start Date].plusBusinessDays({(DaysToShift}})}}
Due Date Value: {{issue.duedate.plusBusinessDays({{DaysToShift}})}}

The error I get in the log is this:

Error rendering smart-values when executing this rule:
Failed to get value for issue.[Start Date].plusBusinessDays({{DaysToShift: {{issue.[Start Date].plusBusinessDays({{DaysToShift}})}}
I am at a loss for why this does not work.  I am hopeful this is something easy I am missing and someone here knows why.

1 answer

1 accepted

5 votes
Answer accepted
Trudy Claspill
Community Champion
October 24, 2022

Try this:

{{issue.duedate.plusBusinessDays(DaysToShift.asNumber)}}
Trudy Claspill
Community Champion
October 24, 2022

You may also want to add conditions to confirm that the Start Date and Due Date fields that you are going to try to set actually already have a value. If the fields are blank you could run into some errors or weird outcomes from apply the plusBusinessDays function.

Justin Baker
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!
October 24, 2022

Thank you very much!  This worked perfectly. 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events