Forums

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

Can you use a literal date in Automation for Jira date comparison

Jeff Gordon
Contributor
July 6, 2023

I need to be able to execute an automation "every two weeks on Wednesday".  Since you can't specify this directly in the Cron expression I am approaching this with a Cron expression to run every Wednesday and have a conditional to check whether or not to skip or continue this week.

This is what I was hoping to be able to use based on determining if I am a multiple of 14 days out from an anchor date.

{{#=}}{{now.diff("2023-06-28").days}} % 14{{/}}

The above should be 0 every two weeks from 2023-06-28 so I would use the above in an advanced compare checking for equals 0.

Unfortunately it doesn't work to have a literal date in the diff function.

Does anyone has a suggestion for how to get that date accepted in the function or how you have implemented the every other week specification in a rule?  Note this is data center so I don't have the ability to set a variable.

1 answer

1 accepted

0 votes
Answer accepted
Jeff Gordon
Contributor
July 6, 2023

Suggest an answer

Log in or Sign up to answer