So I'm far from an automation/JQL/cron expert, but I have a user who's insisting that this automation has always run properly and is just now having issues.
The automation is supposed to run on the day an issue is due, and if it's due that day or past-due, it emails people to let them know.
The cron is as follows:
0 0 4 ? * MON,TUE,WED,THU,FRI *
The JQL is as follows:
duedate <= startOfDay() and resolution =empty and status != Cancelled ORDER BY duedate desc, status
Now, my understanding of this is the following: The cron tells it to run at 4 AM, irrespective of day of the month, every day of the week, regardless of the year. Above the cron expression is a notification that it runs on UTC time... We are EST, which means it would be running at 11 PM of the "previous" day. Tying this into the JQL, say today is the 21st and the due date of the issue is the 22nd. The automation runs at 11 PM on the 21st, checks if the issue due date is less than or equal to the 21st (it's not, it's the 22nd), and so it doesn't email the users (assuming resolution is empty and status isn't cancelled.)
The user is saying this has always run fine before, and expected an email today. The due date was listed as today, and if my understanding is right, the automation last attempted to execute last night at 11 PM, saw the issue was due the next day, and didn't run. I verified it didn't run through audit logs as well, and verified everything else matched through activity on the issue.
Is my assumption correct? I'm going to change the logic of the cron expression to 12 so it checks at 7 AM EST the day of.
One more tip is to use this https://www.freeformatter.com/cron-expression-generator-quartz.html
and verify if the expression you are using matches what its supposed to be doing
Hi @Matt Miller , thanks for your question and working with your user to get this resolved!
Cron expressions can be particularly complex but necessary when you have very specific timing needs. From your post, I wonder if you can use the Jira basic scheduler to accomplish this? It might simplify and weed out anything that is awry about the cron expression.
Something like the following might work for you?
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.