Hello, we have a JQL statement for our weekend oncall tickets however some appear to not hit the criteria necessary. Wondering if this statement is correct for reaching all tickets on Saturday & Sunday.
{{#=}}({{now.convertToTimeZone("America/New_York").dayOfWeek}} > 5) && ({{now.convertToTimeZone("America/New_York").dayOfWeek}} < 7){{/}}
Kind Regards
Here is your original expression, updated to correctly identify Saturday and Sunday.
{{#=}}({{now.convertToTimeZone("America/New_York").dayOfWeek}} = 6) || ({{now.convertToTimeZone("America/New_York").dayOfWeek}} = 0){{/}}
dayOfWeek begins with 0 on Sunday, so Saturday is 6.
Our company is global so I had to check for time in addition to day of week. I started with your A4J expression and modified it to identify events occurring after 02:00 UTC Saturday and before 22:00 UTC Sunday. Our server runs on UTC time so I did not need to convert timezones.
Trigger: Issue Created
Filter: Advanced Compare Condition
{{#=}}
({{now.dayOfWeek}} == 6 && {{now.isAfter(now.withHour(2).withMinute(0).withSecond(0).withMillis(0))}})
||
({{now.dayOfWeek}} == 0 && {{now.isBefore(now.withHour(22).withMinute(0).withSecond(0).withMillis(0))}})
{{/}}
is greater than 0.
Translated to human...
Now is Saturday after 02:00 or now is Sunday before 22:00.
Hi @Kadeem Samuel ,
Can you share more about what are you trying to achieve? Maybe a share your Automation Trigger and conditions would help to understand your issue and propose a solution.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Italo,
Thank you for the reply; the following is the automation we are trying to correct. Basically, want any support request that comes in all day Saturday and Sunday to get tagged as on-call. We have a second automation that handles the weekday time frame
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Can you try this condition instead? This will check if the current day is either Saturday or Sunday in the NYC timezone.
First value: {{now.convertToTimeZone("America/New_York").dayOfWeekName}}
Condition: contains regular expression
Regular expression: (Saturday|Sunday)
I encourage you to also use a log action(see in my image the component under the condition), you can use this to check the {{now.convertToTimeZone("America/New_York").dayOfWeekName}} value in the audit log in execution and it can help you to check the value of your smart value.
Hope this helps!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello @Kadeem Samuel
Did you try with a <=5.?
It may sound nothing, but with the information your question has, I think some of the tickets may jump out with the time conversion in the query.
Let me know if there is any change.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you for replying Sudarshan, I will give that change a shot over the weekend to see how it responds.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.