Heads up! On March 5, starting at 4:30 PM Central Time, our community will be undergoing scheduled maintenance for a few hours. During this time, you will find the site temporarily inaccessible. Thanks for your patience. Read more.
×Context, on a ticket, i have :
What I want to do : calculate the new issue date when the ticket comes back to the "in progress" column
For example :
On the 18/08/2024 I move back the ticket into the "In progress" column, the new issue date should then be 25/08/2024 (Now + (15/08 - 09/08) = 25/08)
You follow me ?
I'm new to smart value and SQL function so I tried something exotic but it doesn't work :
{{now.plusDays(duedate.diff(issue.customfield_10246.toDate).businessDays}}
Anyone figuring this out here ?
Thanks you so much in advance
Welcome to the community.
The diff smart value option is for calculation between date, the output will be a number no a date, as its a calculation.
toDate smart value option is only able to convert text information to a date, and that text needs to be in the correct format
So what could be done is that you:
Thanks to both of you, I got a "success" on that automation but the result is not the one expected.
My custom field is already a date fiel so it works fine as it is without the "toDate".
{{now.plusDays(issue.duedate.diff(issue.customfield_10246).businessDays)}}
which in calculation should look like that :
{{14/08.plusDays(issue.15/08.diff(issue.12/08).businessDays)}}
But the calculation went wrong :
I had :
due date = 15/08
start of blocked ticket = 12/08 (my customfield_10246)
So the result expected when putting the ticket back in the "in progress" column was due date = 17/08 but I got due date = 11/08 instead
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
First try
{{issue.duedate.diff(issue.customfield_10246).businessDays}}
What is the outcome?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ok, I wanted to do it all in one formula but let's go step by step as you suggest, maybe easier.
So I created this automation rule :
{{issue.customfield_10246.diff(now).businessDays}}
--> that works, success, and gives me the number of BusinessDays the ticket spent in the externally blocked column (customfield_10246)
I then added a second rule (screenshot below) to add that number to the due date, it says success but I lost the value in the duedate field, it's now blank so it didn't work :
{{duedate.plusBusinessDays(issue.customfield_10329)}}
result on the ticket :
Any idea on this one ? This one should have been easy, no ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Try, {{issue.duedate.plusBusinessDays(issue.customfield_10329)}}
Otherwise to create a variable that stores the number from the field "Nb de jours...."
lets call the variable {{days}}
{{issue.duedate.plusBusinessDays({{days}})}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I didn't quite get the variable days thing but no need, adding "issue" works like a charm. Thanks a lot for your precious help on this one, really appreciate it !
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Eric Brandenburg -- Welcome to the Atlassian Community!
For a question like this, please post an image of your complete automation rule, images of any relevant actions / conditions / branches, an image of the audit log details showing the rule execution, and explain what is not working as expected. Those will provide context for the community to offer ideas. Thanks!
Until we see those...
Assuming your customfield_10246 is text, the expression you show is missing a closing parenthesis at the end:
{{now.plusDays(issue.duedate.diff(issue.customfield_10246.toDate).businessDays)}}
If instead your customfield_10246 is a date or date / time field, the toDate conversion may be removed:
{{now.plusDays(issue.duedate.diff(issue.customfield_10246).businessDays)}}
Kind regards,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks @Bill Sheboy and sorry for the missing screenshot. See my answer to marc below if you can help
Thanks again
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.