CRON to run every 30 minutes during business hours

Melissa Kibrick December 5, 2022

I want to check a filter and send an alert every 30 minutes but only during business hours. The issue is we are running on Pacific Time so my CRON expression looks like this:

0 0/30 0-1,14-23 ? * MON-FRI

This works well Tuesday to Thursday, but it also send alerts on Sunday afternoon and stops alerts 2 hours early on Friday.

I really don't want to create 2 automations just to get 2 CRON statements.

1 answer

1 accepted

1 vote
Answer accepted
Darryl Lee
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 5, 2022

Unfortunately, I think the situation is still as @Jack Brickey wrote in Nov 2020:

Automation runs at UTC. I wish you could choose your Zone but not there today. 

I wonder if maybe you could use the {{now}} Smart Value and combine it with the convertToTimeZone function to write your own Advanced compare condition. I'll think on this a bit.

Darryl Lee
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 5, 2022

Or maybe something with the toBusinessDaytoBusinessDayBackwards, or plus or diff using BusinessDays (business days are considered to be Monday to Friday, 9am to 6pm)

Sorry, date calculations usually make my head hurt. But maybe you or others could figure out something clever with those?

Melissa Kibrick December 7, 2022

After considering what it would take to implement those smart values, I just went with creating 2 automations. :(

Darryl Lee
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 7, 2022

LOL. Yeah, sometimes the less elegant way is probably simpler. :-}

Like Melissa Kibrick likes this

Suggest an answer

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

Atlassian Community Events