Forums

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

CRON Expression Help For Every Other Weekday

Ricky Lin May 19, 2020

Hi all.  I currently have 2 CRON expressions in place that I don't think is getting exactly what I wanted:

Expression 1: 0 0 8 ? 1/1 WED#2 *
What I want to do: Trigger every other Wednesday at 8AM.  So it should fire off every 2 weeks on Wednesday.
What it seems to do:  Trigger every 2nd Wednesday of the month at 8AM.

Expression 2: 0 0 8 ? 1/1 THU#3 *
What I want to do: Trigger every 3rd Thursday at 8AM.  So it should fire off every 3 weeks on Thursday.
What it seems to do:  Trigger every 3rd Thursday of the month at 8AM.

I'm able to figure out for something to fire every week (like every Tuesday at 8AM), but the two requirements above seem to be not as straightforward.

I've used a lot of Cron expression tools online but none of them seem to have every other weekday.

Would appreciate any feedback.  Thank you!

1 answer

0 votes
Sebastian Krzewiński
Community Champion
May 19, 2020

Hi @Ricky Lin 

 

# specifies the nth occurrence of a given day of the week. For example, 'TUES#2' (or '3#2') means 'the second Tuesday of the month' (that says this doc)

As I know and as I search is very very hard and almost imposible to made cron for every 2 weeks based on standard cron expresions.

 

Please check this question - https://community.atlassian.com/t5/Jira-questions/How-can-I-schedule-a-rule-to-run-every-2-weeks-on-a-particular/qaq-p/655520

Other option that I see is to add two rules and schedule it every month and try to fit that each 2nd rule will be run 2 weeks after 1st rule.

 

Regards,

Seba

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
VERSION
8.5
TAGS
AUG Leaders

Atlassian Community Events