Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root


1 badge earned


Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!


Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.


Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!


Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

Automation - "every other week" schedule?

We have dozens of Jira Server automation rules, and use automation regularly to create issues on a regular schedule.  Since automation uses cron to schedule, we've been able to handle every case. 

Until now.

Our need is to create a new issue every other Wednesday.  Note that this is NOT the first and third week of the month.  Our need is actually every other week.

It seems that cron can't handle this, so is there some other creating way we can get this done inside of Jira automation?

1 answer

0 votes

Hi , 

You're correct @Michael Woffenden that cron expressions don't support the "every other week" schedule directly.

You can try this workaround using two separate automation rules in Jira:

Create the first automation rule:

Schedule the rule to run every 4 weeks on Wednesdays, starting from a specific date.
Add the necessary actions to create the new issue as needed.

Create the second automation rule:

Schedule this rule to run every 4 weeks on Wednesdays, starting from the specific date plus 2 weeks (i. e. , the alternate Wednesday).
Add the same actions as the first rule to create the new issue.

By setting up these two separate automation rules with a 2-week offset, you'll have an issue created every other Wednesday, as desired.




Thanks for your reply.

However, I'm still confused. If we can't create an automation for "every 2 weeks", then how can we possibly do the same for "every 4 weeks?".

I am using Free Online Cron Expression Generator and Describer - to generate the cron expressions.

@Michael Woffenden , 

Apologies for the confusion. I realize that my previous response may not have been as clear as it should have been.

In Jira, you can use cron expressions to create rules that run every 4 weeks. 

Let me try to help you achieve that using the Free Online Cron Expression Generator:

In The Free Online Cron Expression Generator

Set the "Minute" field to the desired minute.

Set the "Hour" field to the desired hour.

Set the "Day of the Month" field to "? " (without quotes).

Set the "Month" field to "*".

Set the "Day of the Week" field to the desired day.

In the "Year" field, set the desired year or use "*" for every year.

Now, to create a rule that runs every 4 weeks, you need to adjust the "Day of the Month" field.

To do this, find the day of the month of the first Wednesday you want the rule to run.

For example, if the first Wednesday is the 7th day of the month, the rule should run on the 7th and then every 4 weeks after that.

To achieve this, set the "Day of the Month" field to "7/28" (without quotes).

Following this approach, you can create two separate automation rules with a 2-week offset between them, so you'll have an issue created every other Wednesday.

For the second rule, set the "Day of the Month" field to the day of the month corresponding to the alternate Wednesday (e. g. , "21/28").

I created some example of a cron expression that runs every 4 weeks at 10 AM on Wednesdays:

0 10 ? * WED#1/28

And here's an example of a cron expression that runs every 4 weeks at 10 AM on alternate Wednesdays:

0 10 ? * WED#3/28

By using what I mentioned above, you may be able to create issues every other Wednesday as desired.




Thanks again for your time and efforts! However I tried your expressions in the "Describe expression" feature, which in essence validates the expression.

Both expressions fail with the error

  • "'?' can only be specified for Day-of-Month or Day-of-Week."


So it seems we might be back to the drawing board?

Can you try this Please :

0 10 1-7,29-31 * WED

0 10 15-21 * WED

And if this does not work then it's a corn expression error due to limitations that they have.

One possible solution we may have is to use a script or external scheduler that can trigger the Jira automation rule on specific dates.

You can use a Python script with the schedule library, which allows you to create more complex schedules than what cron expressions allow. for example:

Install the Python schedule library if you haven't already:

pip install schedule

Create a Python script with this content:

import schedule
import time
from datetime import datetime, timedelta

def create_issue_on_alternate_wednesdays():
# Replace with the actual API call to create a new issue in Jira
print("Creating issue on", datetime. now())

# Schedule the script to run on alternate Wednesdays
next_wednesday = datetime. now() + timedelta((2 - datetime. now(). weekday()) % 7)
schedule. every(2). weeks. at("10:00"). wednesday. at(next_wednesday. strftime('%Y-%m-%d')). do(create_issue_on_alternate_wednesdays)

while True:
schedule. run_pending()
time. sleep(60)
Replace the print statement with an actual API call to create a new issue in Jira. This script will run the create_issue_on_alternate_wednesdays() function every other Wednesday at 10:00 AM.

Remember this requires you to run the script on a server or machine that is always on and has access to Jira.



Still getting errors, I agree that cron cannot handle this. 

We'll go the script route (we use powershell), or possibly we might be able to swing something within automation, since some date math can be done there.

Thanks for the ideas!

@Michael Woffenden 

If you use PowerShell for scheduling tasks, you can create a script that will run on alternate Wednesdays.

function Create-IssueOnAlternateWednesdays {
# Replace with the actual API call to create a new issue in Jira
Write-Host "Creating issue on $(Get-Date)"

function Get-NextAlternateWednesday {
$today = Get-Date
$nextWednesday = $today.AddDays((2 - $today.DayOfWeek.value__) % 7)
if ($nextWednesday -lt $today) {
$nextWednesday = $nextWednesday.AddDays(7)
return $nextWednesday.AddDays(14) # Return alternate Wednesday

$nextRun = Get-NextAlternateWednesday
$action = { Create-IssueOnAlternateWednesdays }
$trigger = New-ScheduledTaskTrigger -Once -At $nextRun

$taskName = "Create Issue On Alternate Wednesdays"
$taskDescription = "A task to create a Jira issue on alternate Wednesdays"

Unregister-ScheduledTask -TaskName $taskName -Confirm:$false -ErrorAction SilentlyContinue
Register-ScheduledTask -TaskName $taskName -Action $action -Trigger $trigger -Description $taskDescription

I hope this will help,  and happy to hear about the result. 




Suggest an answer

Log in or Sign up to answer
AUG Leaders

Atlassian Community Events