Recurring card scheduled for 3 days before the first friday of the month
Asked by Camilla Braganca:

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?


Answers:
author: Trudy Claspill
body: Hello [@Camilla Braganca](/t5/user/viewprofilepage/user-id/5551944)

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.)

![Screenshot 2024-07-25 at 2.40.55?PM.png](https://community.atlassian.com/t5/image/serverpage/image-id/338040iBE712C46B605E788/image-size/large?v=v2&px=999 "Screenshot 2024-07-25 at 2.40.55?PM.png")

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.

![Screenshot 2024-07-25 at 2.42.19?PM.png](https://community.atlassian.com/t5/image/serverpage/image-id/338042i1F9DFB6FBB0B217A/image-size/large?v=v2&px=999 "Screenshot 2024-07-25 at 2.42.19?PM.png")

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.

* Create the task. Set the due date to today (16th) plus 14 days, making the Due date July 30th. That is three days before the first Friday of August, which is August 2nd.

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.

comments: author: Trudy Claspill
body: Hello [@Camilla Braganca](/t5/user/viewprofilepage/user-id/5551944)

Were you able to solve your requirement with the guidance I provided?

Do you have additional questions?


author: Fernando Eug?nio da Silva
body: [@Camilla Braganca](/t5/user/viewprofilepage/user-id/5551944) , 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 :)


Tags: cloud

jira-cloud