CRON Expression for every 2 weeks

Harry Bob
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.
July 14, 2020

Hello, 

 

I want to use the CRON expression for every 2 weeks for one of my Filters to send out to users.

Haven't been able to find it online. Is it possible? I saw a link below that might be able to do it but seems to only apply if you're using Automation for Jira which I'm not using.

 

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

 

Thanks 

1 answer

1 vote
Daniel Eads
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 14, 2020

Hi Harry,

The normal subscriptions for filters are powered by cron expressions in the backend. The GUI can simplify things a bit, but the issue is that cron doesn't support "every two weeks" or "every 14 days" as expressions. You could add two separate simple subscriptions for the first and 15th of the month perhaps:

image.png

or a single subscription using the cron expression:

0 0 1,15 * *

This might lead to some trouble though if you're trying to line up with sprints that might run every 2 weeks exactly, since the days will drift a bit from month to month.

The solution you found for Automation is great because it sidesteps the limitation with cron. And the good news is that Automation is now built-in to Jira in Cloud, so you do have access to run the rule outlined in that thread without any additional apps or cost. I'm happy to help answer questions about the Automation configuration if you'd like.

Cheers,
Daniel

Harry Bob
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.
July 15, 2020

Hi @Daniel Eads 

 

Thanks for your reply and suggestion. I don't think that would work for me. I should have been a bit more specific. I would like to send out every 2 weeks on a Tuesday.

 

If you have any other suggestions please let me know I'm happy to see if I can work around it. If not then I'll have to send it every week.

 

Thank you

Like Nathaniel Victor likes this
Nathaniel Victor February 12, 2021

I second this... we want to do the same. Every 2 weeks is different than the 1st and 3rd Tuesday of a Month...

Daniel Eads
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
February 12, 2021

Hi @Nathaniel Victor - just want to note that this is a technical limitation of cron and won't be remedied in Jira filter subscriptions. The standard unix fix for this is to run a script every 7 days, but use logic inside the script to "skip" every-other run (see this discussion on Linux Questions for more info). As you can't run scripts inside Jira filter subscriptions and only have the cron expression available, the every-other workaround doesn't apply.

You can replicate the subscription functionality with a Jira Automation rule:

  • When: Scheduled
  • Then: Lookup issues
  • And: Send email

The scheduled trigger in automation has cron expressions, but also supports a fixed-rate schedule of every __ minutes/hours/days. The Send daily notifications with a list of all open issues in current sprint rule in the template library is a great starting point - switch the trigger to the days you need, change the lookup action to match your JQL search, and swap the Slack message action for sending an email.

Suggest an answer

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

Atlassian Community Events