Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Why is Jira complaining about the month in my CRON statement?

Rick Muller January 17, 2024

I am trying to run an automation rule on a particular day of the year (in my example it is Jan. 17th).  No matter what I do, Jira comes back with the message saying "The values for month must be from 1 to 12".  I have tried many different formats, including using JAN as well as leaving the CRON empty, and it still comes up with the same error message, which makes me think it may not be the month that it is complaining about at all.

Here is an example of my CRON statements I have tried.

0 0 23 17 1 ?

As I understand, this should translate to:

second=0

minute=0

hour(UTC)=11pm

day=17

month=1

day of the week=not specified.

Attached is a screenshot of the error.  Any suggestions would be greatly appreciated.

CRON screenshot.png

3 answers

2 accepted

1 vote
Answer accepted
Nic Brough -Adaptavist-
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 17, 2024

Welcome to the Atlassian Community!

I seem to remember you get an error about the last entry in the expression if the expression is too short.  You need to add a week, it needs 7 entries!

Rick Muller January 18, 2024

Hi Nic,

Thanks for the answer.  I tried updating one of my automation rules with a CRON that was for the 1st of February and it did not complain about the month.  Based on this, I believe your answer is correct.

Thanks again,

Rick

0 votes
Answer accepted
Joseph Chung Yin
Community Champion
January 17, 2024

@Rick Muller 

I agreed with both community leaders responses.  I have also tested out your Cron syntax without any problem.  I would also recommend that you recreate the rule again and ensure that there are no extra spaces in your Cron expression.

Hope this also helps.

Best, Joseph Chung Yin

Jira/JSM Functional Lead, Global Technology Applications Team

Viasat Inc.

2 votes
Ste Wright
Community Champion
January 17, 2024

Hi @Rick Muller 

Cron looks correct - I tried it in a Scheduled Rule and it accepted it.

As a simple first step, try recreating the rule - see if that helps.

Ste

Rick Muller January 18, 2024

Thanks for your answer Stephen.  I built a new automation with a similar CRON statement and it didn't complain about the month as expected.

This brings up another question.  I have 12 rules which each have 20 to 30 subtask creation actions.  I was hoping to edit Each of these rules to use a CRON schedule statement, but it looks as if I may have to build them from scratch.  My question, is there a way that I am able to copy those actions from one rule to another?  I am hoping to avoid the manual task of recreating over 300 subtask actions.

Thanks again,

Rick

Ste Wright
Community Champion
January 19, 2024

Hi @Rick Muller 

Not that I know of.

But you can clone an entire rule - so you could clone each and then remove the irrelevant parts?

You can copy a rule from the main rules list - hover over the rule and on the right-hand side breadcrumbs (...) will appear. The copy option is in this drop-down.

Ste

Suggest an answer

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

Atlassian Community Events