CRON expression not triggering rule

Adrian Avalos
Contributor
June 11, 2024

Hello. I created automation rule with scheduled trigger that should send out email with table of issues being pulled from jql filter every Monday afternoon at 2:00 PM using CRON expression 

0 00 14 ? * 1

When I run rule manually it works as intended but the automation rule wont trigger at desired time using CRON expression. Would someone be able to help with this? This is Datacenter version of jira

Capture 1.PNGCapture 2.PNGCapture 3.PNG

3 answers

1 accepted

2 votes
Answer accepted
J. Caldwell
Contributor
June 11, 2024

Your Cron expression is wrong:

0 00 14 ? * 1

is what you have listed which reads

0 (at the top of every minute) 00 (doesn't exist - minutes are 0-59) 14 (on the 14th day of the month) ? (for any month) * (on every day of the week) 1 (not right here, this would only apply to year 1)

 

What you want is: 

0 0 14 ? * MON 

0 (at the top of every minute) 0 (on the top of the hour) 14 (on the 14th hour) ? (any day of the month ) *(of every month) MON (that is a Monday)

That should work. Year is optional, which would be a * at the end after the MON.


J. Caldwell
Contributor
June 11, 2024

The cron format that Atlassian is using is covered under the "Construct a cron expression for a filter subscription":

https://confluence.atlassian.com/jirasoftwareserver/constructing-cron-expressions-for-a-filter-subscription-939938814.html

Adrian Avalos
Contributor
June 12, 2024

Hi @J_ Caldwell I tried your recommendation and modified to a different time just for testing purposes and to not have to wait until Monday, but unfortunately still did not work and looking in the audit log displays nothing after my config change. Rule is not triggering still. This is what I used

0 18 11 ? * WED

J. Caldwell
Contributor
June 12, 2024

@Adrian Avalos  -

I noticed your "scheduled" trigger doesn't look the same as the cloud one -> It references server time: Cloud doesn't run off a server time like that, but one based off UTC. All your tagging of the problem indicates cloud. 

Are you using Cloud or DC or Server? Because it looks like you are using DC/Server which has some different things that are different than in Cloud. 

  • Rules only run at most every 5 minutes, can't go lower than that, so you need to put out the next run at least 5 minutes from your last try. (see your screenshot)
  • Rules have a variance of 5 minutes in DC/Server (they can launch up to 5 minutes after the scheduled time) (see your screenshot)
  • Everything needs to be calculated based off the server time -> If you are on the west coast and the server time is east coast, if you set it to kick off at 10am PT, it will actually "run" at 7am ET. This goes the same way if you are trying to schedule it to run 10 minutes from now, you don't do the time conversion right, you'll end up running it tomorrow. 
  • Cloud Cron and DC/Server Cron are different. I don't remember if Cron on DC/Server takes into account seconds. 

Any or all of those points could be why "it didn't run." 

Recommend setting up a simple test automation to nail the timing and behavior first -> Set up an automation to send you an email, nothing else, just the email. Nail the timing simply and then expand. Get it to send you something every day at a particular time first, then adjust. Make sure to give it +10 minutes after it should have run to try again.

Adrian Avalos
Contributor
June 18, 2024

Thanks @J_ Caldwell 

The time zone was different like you suggested and as well switching the format from "0 0 14 ? * MON" to "0 00 15 ? * 2" . This is on Data Center

0 votes
Aaron Pavez _ServiceRocket_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 11, 2024

Hi @Adrian Avalos 

Is the CRON value correct?

0 14 * * MON -> this is the right one per https://crontab.guru/

Yours doesn't return anything.

2024-06-11 17_19_04-Crontab.guru - The cron schedule expression generator.jpg

Regards

Aaron

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 11, 2024

@Aaron Pavez _ServiceRocket_ 

Atlassian's cron expressions for rules and filter subscriptions include a position for seconds at the beginning of the expression. 

https://confluence.atlassian.com/jirasoftwareserver/constructing-cron-expressions-for-a-filter-subscription-939938814.html

crontab guru does not.

Like # people like this
0 votes
Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
June 11, 2024

Hello @Adrian Avalos 

When you review the Audit Log for the rule, at what time does it show the rule being triggered?

Adrian Avalos
Contributor
June 12, 2024

Hi @Trudy Claspill  the audit log displays nothing after my config change. Rule is not even being triggered I believe

Suggest an answer

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

Atlassian Community Events