Forums

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

Automation rule comparing times is triggering when it shouldn't

Jeffrey Bistrong
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
November 15, 2023

We have a process that is supposed to begin at a certain time (3 PM).

 

When it hits 45 minutes before the task is supposed to begin its supposed to transition it from Backlog --> On Deck

 

When it hits 5 minutes before it is supposed to transition it from On Deck --> Ready to begin. 

 

However both of these rules do not work the way it is supposed to.

 

We have a custom field called start time, its a free text field. 

 

First if statement

{{now.convertToTimeZone("America/Los_Angeles").plusMinutes(45).shortTime}}

greater than

{{issue.customfield_11976.todate("HH:mm:ss").shorttime}} (this is the start time field)

 

Then it is supposed to transition it only if its within 45 minutes of the start time, but it always transitions it no matter whatMonosnap Automation - Jira 2023-11-15 10-16-01.pngMonosnap Automation - Jira 2023-11-15 10-15-25.pngMonosnap [RRNC-2974] test - Jira 2023-11-15 10-17-23.png

 

 

 

 

1 answer

0 votes
Trudy Claspill
Community Champion
November 15, 2023

Hello @Jeffrey Bistrong 

Can you clarify this point?

"When it hits 45 minutes before the task is supposed to begin"

Should it transition only if it is within 45 minutes of the start time?

If start time is 3:00 pm and now is between 3:00 and 3:45 pm, the issue should transition?

If start time is 3:00 pm and now is between 2:15 pm (45 minutes before 3 pm), should the issue transition?

If start time is 3:00 pm and now is between 4:00 pm (60 minutes after 3 pm), should the issue transition?

 

The way you have written the comparison, it is simply comparing that now + 45 minutes is later than the scheduled start time. 

 

I can also hypothesize that there are two other factors that may be influencing the comparison.

1. You did not convert the start time to a particular timezone, so it may be getting interpreted as UTC. In that case 9:20 am LA time is indeed later than 3:00 pm UTC.

2. Possibly, but unlikely, the comparison is being done as text rather than time.

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