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
If: Compare two values
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.
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
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Arielei, I have tried your solution but it sends email at every hour of the day, unfortunately...
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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:
Kind regards,
Bill
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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!
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.