Good morning - I need assistance with a time formula within an automation. I am trying to add a formula that will change the time and/or due date if a specific priority value is selected. Please assist - thanks so much!
Example: When Value changes for Priority, Priority equals Urgent, then edit issue fields Time to (increase by 2 hours)
So if a user entered the form at 10am, the due date is still today, but at 12noon.
Hello @Sheryl.Patton-Dandridge
Welcome to the community.
Have you reviewed the information available here?
https://support.atlassian.com/cloud-automation/docs/jira-smart-values-date-and-time/
What have you tried?
What is the type of the field you want to update?
If it is a date/time field then the "plus" function should do the trick.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Trudy Claspill I tried this - I'm getting closer, but no solution yet. I want to create the formula for same day plus 2 hours.
I'm using this: {{[date].plus[Hours]([number])}}
Is this correct? I feel like I may be missing something.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Sheryl.Patton-Dandridge
[text] represents something you have to replace.
[date] has to be replaced with a reference to the date/time field (or a date/time value) to which you want to add time; i.e. issue.duedate or now
[Unit] needs to be replaced with the time unit you want to use; i.e. plusHours
[number] needs to be replaced with the number of time units you want to add; i.e. 2
Are you trying to update a field that is only a time field or is it a date/time field?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It's a due date field -
{{now.plusBusinessDays(0)}}
And a time field -
{{{now].plus[Hours]([2])]]
But looking at the above, I need to take some of those symbols out, I think...the due date field is working fine. Let me change it - one moment.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
{{now.plusHours(2)}}
I don't believe that Jira Cloud natively has a field that is just a Time type field. I see Date Picker and Date Time Picker. Do you have an app that added a Time type of custom field?
If you have a field that truly is just a Time custom field then you will also need to add a format function to the above code to reduce it to just a time value, because now is a date/time value. The result of the above code would be a date/time value.
The document I linked previously has functions for formatting date/time data.
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.