Help with Cron Expression rule

Chasovskikh Kirill
Contributor
April 13, 2022

hi, community!

i'm trying to write automation rule, that creates issue 

every 2 weeks on tuesday, at 11:20

basic functionality supports time like 11:00 or 11:30, and doesn't allows to set time 11:20

i'm creating CRON like

0 20 11 ? * 2/14

but receiving error "The step interval for day-of-week must be less than 7: 14"

is there another way to make 2weeks-step?

thank you!

3 answers

1 accepted

1 vote
Answer accepted
Stefan Salzl
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 13, 2022

Hi @Chasovskikh Kirill 

the easiest way that comes to my mind would be to set the cron to weekly and add a condition right afterwards that checks the checks for the week (eg. calculate if it‘s odd week and only run rule if the condition is true).

Hope this is helpful.

Best
Stefan

Stefan Salzl
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 13, 2022

@Chasovskikh Kirill 

In case this solves your problem please consider to accept the answer. This makes it easier to find the solution for other people facing the same/similar problem.

Thanks in advance.

Best
Stefan

Chasovskikh Kirill
Contributor
April 14, 2022

Thank you! 

This is the best solution.

Like Stefan Salzl likes this
1 vote
Bill Sheboy
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.
April 13, 2022

Hi @Chasovskikh Kirill 

Looking at that expression and the error, the rule is noting your values for Day-of-Week are out of range, as 14 is greater than 7 days in a week. 

Please take a look at this page which shows examples that match what you wanted:

https://support.atlassian.com/jira-software-cloud/docs/construct-cron-expressions-for-a-filter-subscription/

Kind regards,
Bill

0 votes
Vikrant Yadav
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 13, 2022

Hi @Chasovskikh Kirill There is no cron expression for every 2 weeks. You can use following CRON :- 

0 20 11 ? 1/1 TUE#2 *

 RUN AT 11:20 EVERY MONTH TUESDAY 2 OF EVERY MONTH

If Above doesn't work try this one :- 

0 20 11 ? * 3#2 *

At 11:20:00am, on the 2nd Tuesday of the month, every month

Seconds Minutes Hours Day Of Month Month Day Of Week Year
0 0 0 ? * 3#2 *

http://www.cronmaker.com/;jsessionid=node01vvidrxxqkbgre44hiri8snz0381389.node0?0

 

Thanks

V.Y

Suggest an answer

Log in or Sign up to answer