CRON expression not triggering rule
Asked by Adrian Avalos:

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.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/329280i4C39C84F80E9E6A8/image-size/large?v=v2&px=999 "Capture 1.PNG")![Capture 2.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/329278i638C23D83A7DE5F2/image-size/large?v=v2&px=999 "Capture 2.PNG")![Capture 3.PNG](https://community.atlassian.com/t5/image/serverpage/image-id/329279i9DFAFBFBCC089F50/image-size/large?v=v2&px=999 "Capture 3.PNG")


Answers:
author: J_ Caldwell
body: 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.  

<br />

comments: author: J_ Caldwell
body: 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>


author: Adrian Avalos
body: Hi [@J_ Caldwell](/t5/user/viewprofilepage/user-id/5491182) 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


author: J_ Caldwell
body: [@Adrian Avalos](/t5/user/viewprofilepage/user-id/5479284) -

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.


author: Adrian Avalos
body: Thanks [@J_ Caldwell](/t5/user/viewprofilepage/user-id/5491182)

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


author: Aaron Pavez _ServiceRocket_
body: Hi [@Adrian Avalos](/t5/user/viewprofilepage/user-id/5479284)

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](https://community.atlassian.com/t5/image/serverpage/image-id/329291i110D28922E65B783/image-size/large?v=v2&px=999 "2024-06-11 17_19_04-Crontab.guru - The cron schedule expression generator.jpg")

Regards

Aaron

comments: author: Trudy Claspill
body: [@Aaron Pavez _ServiceRocket_](/t5/user/viewprofilepage/user-id/4482404)

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.


author: Trudy Claspill
body: Hello [@Adrian Avalos](/t5/user/viewprofilepage/user-id/5479284)

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

comments: author: Adrian Avalos
body: Hi [@Trudy Claspill](/t5/user/viewprofilepage/user-id/3569011) the audit log displays nothing after my config change. Rule is not even being triggered I believe


Tags: automation

cloud

cron

jira-cloud