Forums

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

Automation Rule Failing

Devin Holland November 20, 2023

 

Can anyone help me understand why the second condition is failing when it's basically written the same as my first condition? 

 

Failed Automation Task.png

3 answers

1 accepted

1 vote
Answer accepted
Tim Kopperud
Community Champion
November 21, 2023

Hi @Devin Holland, I think the rule can be simplified. You might try something like this:

image.png

With the JQL

(created > startOfDay() and created < startOfDay("8h")) OR (created > endOfDay("-8") and created < endOfDay())

TimK.

Tim Kopperud
Community Champion
November 24, 2023

Hi @Devin Holland, thanks for accepting the answer. I'm really glad the suggestion helped. 

TimK. 

1 vote
Bill Sheboy
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 21, 2023

Hi @Devin Holland -- Welcome to the Atlassian Community!

When performing date/time comparisons in automation rules using conditions, please check if the typing supports your intent.

Specifically, using things like longTime lead to a text expression.  And so the compare no longer has the benefits of a date/time type to help.  Will the converted text values correctly align with the clock time values you expect in the compare, with leading zeros and date components ordered as needed?

Kind regards,
Bill

0 votes
Darryl Lee
Community Champion
November 20, 2023

Hi @Devin Holland --

I think you're trying to catch tickets created between 5PM and 8AM CST?

So I believe the problem is that you didn't account for midnight.

That is, let's say a ticket was created at 6AM. That is definitely less than (before) 8AM.

But is it greater than (after) 5PM?

In our heads, yes. But according to the computer, no.

So I think what you really need is an OR operator for your comparisons.

At first I didn't think this was possible, but I played around with the IF, ELSE: add condition options component and figured out I could do ORs by choosing the "Run actions if... At least one condition matches" option! Cool!

Screenshot 2023-11-20 at 8.49.22 PM.png

I think this should work. Please let us know!

Devin Holland November 21, 2023

I ended up using your suggestion of using ELIF block. Changed to issue.created.shortTime and i had success. Thanks for your assistance. 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events