Hello everyone,
I want to calculate a field using automation. Starting from the start date, I want to calculate 20 weeks into the future and if it is not a Monday, I want to use the next Monday. Atlassian has introduced the two commands mentioned above, but it seems that they cannot be used in one command. I have tried the following so far:
direkt way:
{{issue.start Date.plusWeeks(20).withNextDayOfWeek("TUE")}}
{{issue.start Date.withNextDayOfWeek("TUE").plusWeeks(20)}}
and indirekt way:
Create variable:
Var: {{varPlusWeek}} which has the following smart value included: {{issue.start Date.plusWeeks(20)}}
And in the next step with extention:
{{varPlusWeek.withNextDayOfWeek("TUE")}}
But nothing has worked. Is it simply not possible, e.g. due to the format or other reasons, or am I making a mistake here? Thank you very much.
Best regards
Chris
Hello @Chris M_
Welcome to the community!!
I have gone through the post and in my understanding, you intend to add 20 weeks from the date of creation. If that is the case, please try the below operation:
{{issue.created.plusWeeks(20).withNextDayOfWeek("TUE")}}
I have replaced 'start Date' with 'created' which is the smart value to fetch the created date of a ticket.
Please feel free to share your thoughts and feedback on this, including if there is any other usage.
-GG
Hello @Gaurav
thank you for posting your suggestion. But I realy mean issue.start date. It's a field of Jira by default oder of tempo. Process: The ticket is created in the past. After a while the project lead negotiated the final project start with our customers (start date) and has also to enter the due date manually with the constraints mentioned above. Due to Jiras ability to calculate dates I will calculate the due date automatically.
But I do not understand which Jira has problems with the expression of plusWeeks.withNextDayOfWeek.
Thank you in advance.
Chris
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for sharing the context @Chris M_
Please see if the below calculation helps:
{{issue.Start date.plusWeeks(20).withNextDayOfWeek("TUE")}}
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.
Hi @Chris M_
The reasons some of your early attempts did not work could be...
Smart values are name, spacing, and case-sensitive, and you were using the incorrect case for the field. To learn the correct smart values for a field, please use this how-to article: https://support.atlassian.com/cloud-automation/docs/find-the-smart-value-for-a-field/
Variables are text. When you want to use a date saved as text, it must be converted to a "date type" using toDate: https://support.atlassian.com/cloud-automation/docs/examples-of-using-smart-values-with-dates/#Converting-text-to-dates
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.