Hi everyone!
I need to create a recurring card scheduled for 3 days before the first friday of the month. I tried the basic session on the automation, but it doesn't solve my problem.
How can I build a JQL that would solve this problem?
Hello @Camilla Braganca
Do you mean you want to set the Due Date on that issue to be 3 days before the first Friday of the month?
How far in advance of that date do you want this card created?
Let's say you want the recurring task created 2 weeks before it is due. And if it will be due 3 days before a Friday that means it will be due on a Tuesday. So, create a rule that runs every Tuesday.
In that rule you could add a condition to check if day on which it runs is 2 weeks + 3 days before the first Friday of a month. If it is, then you want to create the recurring task.
To determine if that date 17 days from the Tuesday is the first Friday of the month, check that its day-of-month value is less than 8. (The first Friday could have dates 1 through 7, with the date being 7 if the first day of the month was the previous Saturday.)
If that condition passes, then it is the right time (2 weeks in advance) to create the new task.
Set the Due date for the task being created to 14 days from the date the rule is running.
Lets run through some examples, using this month (July).
If the rule ran on Tuesday the 2nd, 17 days from then would be Friday then 19th. 19 is not less than 8, so that Friday is not the first Friday in the upcoming month.
If the rule ran on Tuesday the 9th, 17 days from then would be Friday then 26th. 26 is not less than 8, so that Friday is not the first Friday in the upcoming month.
If the rule ran on Tuesday the 16th, 17 days from then would be Friday then 2nd. 2 is less than 8, so that Friday is the first Friday in the upcoming month.
You can keep running through examples to prove to yourself that the recurring task would be created correctly, 2 weeks in advance of the first Friday of the month.
Hello @Camilla Braganca
Were you able to solve your requirement with the guidance I provided?
Do you have additional questions?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Camilla Braganca , Welcome to the Atlassian Community!
I believe that what you actually need is to use a CRON expression in your Scheduled trigger automation.
In Scheduled you can use advanced CRON expressions to get closer to the scheduled execution you expect.
This cron expression for example will run every first Friday of each month at 12:00 PM: 0 0 12 ? 1/1 FRI#1 *
If you are not confortable with cron expressions you can use a Cron Maker site to help you, like this one: http://www.cronmaker.com/?1
Hope this helps you :)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.