Hello community,
I need your help, I want to automatically update due date when start date is postponed.
At ticket creation, Start Date & Due Date has been completed by user.
When user postpones start date, I want to get difference of business days between the initial start and the new value then I add this difference to the due date
ex: Initial start Date 2024-07-16, user changes to 2024-07-17
Difference days => 1day
Automation rule to update Due Date +1 Business Day
I create this rule but at calculation level,:
1. I create a customfield to get intial start before changing
{{fieldChange.from}}
2. I create a variable "businessDaysToAdd "to calculate difference between initial start date to new start date
{{issue.customfield_10044.diff(issue.customfield_10861).businessDays.abs}}
3. Update due date with calculation with Date plus function
{{DueDate.plusBusinessDays(businessDaysToAdd)}}
It seems that a variable inside calculation Date.plus function is not take into account.
Here my automation rule and my calculation.
Thank you in advance for your help ;)
Created variables are text, and to use them in a function requiring a number they must be converted by adding asNumber. For example:
{{issue.someDateField.plusDays(varSomeVariable.asNumber)}}
Here are some other recommendations for the rule you show:
Kind regards,
Bill
Hi @Bill Sheboy
I was sure it was this type of subtlety but I couldn't find how to indicate that the result was a number.
Thank you it works !!!
I don't find documentation to talk about variables properties, I really appreciate if you have any pages on this subject :)
To answer to your questions:
To open the discussion, It's strange that timeline doesn't take into account this kind of case regarding business days when we move the start date date near of the weekend, the system will just move due date without taking into account the weekend whereas we are able to define business days and non working days.
In any case thanks a lot for your help Bill !
Kind regards,
Cedric
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Awesome; I am glad to learn that helps!
Regarding your other questions...
For documentation on Create Variable, this is all there is: https://support.atlassian.com/cloud-automation/docs/jira-automation-actions/#Create-variable And it does state the value is a string, but it does not suggest what to do when the value could be typed otherwise.
A workaround that sometimes helps is to use Create Lookup Table with a single row, as the values for those preserve the typing. That may be for edge cases, as the table lookups may not fit all usage scenarios.
Regarding the timeline and adjustments, I do not have any suggestions for that. You appear to be on Jira Premium, and so likely have Advanced Roadmaps versus Basic Timelines. IMHO, neither really works like a purpose-built, project management tool, and so changing a single date in the middle of the chain needs to be handled other ways.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.