Forums

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

Automation expression: Plus Hours(1)

Karoline Rezende Ramos
Contributor
September 18, 2023

Hello Community!

I need your help :)

I'm trying to set up an automation that performs the following logic:

I have a field named Closed Date/Time that is filled in when closing a change via postFunction.

And we have the Planned End Date field that informs the end date/time of the implementation of the change.

The team has a deadline of 1 hour after the Planned end date to finalize the change, otherwise it would have to mark the change as unfulfilled.

But I'm having trouble setting up this expression.

Changes that have been resolved within 1 hour of the planned end date will be marked as completed and those that have passed the 1 hour mark as not completed, that's the idea.

Can you help me?

Screenshot.png

1 answer

1 accepted

1 vote
Answer accepted
Trudy Claspill
Community Champion
September 18, 2023

Hello @Karoline Rezende Ramos 

Have you tried to execute this Automation Rule? What is the outcome? What information is in the Audit Log for the rule execution?

Karoline Rezende Ramos
Contributor
September 19, 2023

Hi @Trudy Claspill 

I'll share it with you, look at this example

The time in the Date/Time Closed field is greater than Planned end date+, the rule should have marked this ticket as unfulfilled.

I'll share all the details with you.

Screenshot (4).png

Screenshot (1).pngScreenshot (2).pngScreenshot (3).png

Trudy Claspill
Community Champion
September 19, 2023

Is the field that you called "Date/Time Closed" a date/time field?

You said:

And we have the Planned End Date field that informs the end date/time of the implementation of the change

Is Planned End Date just a date or a date/time field?

 

The first value of your compare is

{{issue.Planned End date.now.plusHours(1).shortTime}}

 

Have you tried using the Log action to print the actual value of that smart value into your Audit Log, to see if you are getting what you expect for that value? I think you will find that you are not getting what you expect.

If Planned End date is actually a date/time field, then to figure out what the right date/time is for one hour later would be:

{{issue.Planned End date.plusHours(1)}}

now is not appropriate to use within that smart value. now is used to get the current date and time.

Adding the format command shortTime to the smart value is also not appropriate. That would convert you date/time value to just a time value. In the comparison you are trying to compare to another date/time value. You can't effectively compare a time-only value to a date/time value.

Like Karoline Rezende Ramos likes this
Trudy Claspill
Community Champion
September 28, 2023

Hello @Karoline Rezende Ramos 

Have you been able to solve your issue with the information I provided?

If so, please consider marking my Answer as Accepted.

Like Karoline Rezende Ramos likes this

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