Forums

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

Automation - send email if work item created between 4PM and 8AM does not work

Jagoda Zawadzka
Contributor
November 24, 2025

Hi all,

 

I have made an automation that should send emails to specified addresses whenever a work item (that is not a Subtask) is created between 4PM and 8AM.

This is how the setup looks:

 

When: work item created

Conditions applied: Issue Type does not equal Subtask

 

If: Compare two values

First value* (required): {{issue.created.format("H")}}
Condition
greater than
Second value: 16
Then: Send Email
[To, Subject and Content are populated correctly]

If: Compare two values

First value* (required): {{issue.created.format("H")}}
Condition
less than
Second value: 8
Then: Send Email
[To, Subject and Content are populated correctly]
This doesn't seem to work.
My customer who usually opens cases in between those hours is from Singapore (=a very different timezone). Might this be the reason?
If not, does anybody have any ideas as to how to make it work?
I'll apreciate any help!
Thank you
Jagoda
[Edit: I'm trying to format my message to look nicer but it doesn't save my changes, apologies]

2 answers

1 vote
arielei
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 24, 2025

Hello @Jagoda Zawadzka 

First, if you run the trigger on issue created, then i suggest you will change the format to "now()" instead of "{{issue.create.format("H")}}".

Now, keep in mind that Jira cloud instance is based on UTC + 0.

So first add to the log the current time that the now() gives you.

 

you'll probably see different time between your timezone and users timezone.

so you need to understand what is the time of the now() function between 4PM to 8PM.

 

Hope that will work, 

let me know

Ariel.

Jagoda Zawadzka
Contributor
November 24, 2025

Thank you Arielei! I have implemented the changes and will test it later today. Do you think adding branches 'for Current issue' would change anything? Thanks

Like Susan Waldrip likes this
arielei
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 24, 2025

Hello @Jagoda Zawadzka 

i dont see a reason to use branches in your scenario, simply use a trigger when issue is created you can catch it by the trigger {{triggerIssue}} and check it.

Like # people like this
Jagoda Zawadzka
Contributor
November 25, 2025

Hi Arielei, I have tried your solution but it sends email at every hour of the day, unfortunately...

0 votes
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 24, 2025

Hi @Jagoda Zawadzka 

First, I recommend continuing to use {{issue.created}} in your expressions: that will be when Jira created the work item as opposed to {{now}} which is when the rule eventually runs.  During Atlassian outages and problems with rule slow downs, the values will definitely be different: now will be after created.

Next, your expression is using format("H"), which converts the date / time into text.  Thus, the greater than / less than checks you are using with the Smart Values Condition will compare text, and not numbers, leading to unexpected results.

Finally, I can think of several ways to do what you ask:

  • Use a math expression with Boolean operators to keep everything as numbers to test within the range of values
  • When converting to text with format("H"), use a match() function with a regular expression to check the hour as text exactly matches your possible range values.
  • Use additional variables, or placeholder values for compare with date / time functions of isAfter() and isBefore(), such as adjusting {{now}} to yesterday at 1600 and today at 0800 for the comparisons.  I recommend not using this approach: it is prone to simple errors and I have observed both of those functions in rules produce incorrect results.

 

Kind regards,
Bill

Jagoda Zawadzka
Contributor
November 25, 2025

Thank you Bill! I have now tried comparing values:
First: {{#=}} ({{issue.created.format("H")}} >= 16) || ({{issue.created.format("H")}} < 8) {{/}}
equals
Second: 1

 

I'll let you know if that works!

Like Bill Sheboy likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events