how2 create an automation rule that creates a recurring task on the 2nd Tuesday monthly
Asked by Darren:

Jira Data Center 9.1.1

Automation for Jira

I want Automation to create a task on the 2nd Tuesday each month, and transition that task immediately to 'Ready to start next' (this is because I use the Kanban Backlog view, and I have a 'Ready to start next' as my leftmost Kanban column)

In summary: At this scheduled time (2nd tuesday) \> create issue \> and transition into 'ready to start next'

The 'Scheduled' Trigger points me to this doc: [Construct cron expressions for a filter subscription \| Jira Software Cloud \| Atlassian Support](https://support.atlassian.com/jira-software-cloud/docs/construct-cron-expressions-for-a-filter-subscription/)

I can see I can do something like "'TUES#2' (or '3#2') means 'the second Tuesday of the month'."

However, when I enter the following...

0 0 0 ? \* TUES#2

...as my 'cron expression' in the 'Scheduled' Rule Trigger I get an error: Invalid day-of-week name: 'TUES'

So I changed it to this (following the documentation):

0 0 0 ? \* 3#2

...and Automation then complains "The rule has been configured with components that require issues to be provided by the trigger. You need to use the option to run JQL to provide issues. The following components require issues: Transition issue"


Answers:
author: Darryl Lee
body: Hi [@Darren](/t5/user/viewprofilepage/user-id/618068)!

I'm not sure why

```
0 0 0 ? * TUES#2
```

Doesn't work, as the docs do clearly show that should work. But yeah, I used your second expression and it got past the error about the cron expression.

As to your other error, I'm guessing it might be because you are not using a "Branch" for your transition action, and so Automation doesn't know what issue to transition.

What you need to add after the **Create issue** step is:

* **New Branch**
* **Branch rule / related issues**
* **Most recently created issue**

And then within this branch, you would put your **Transition** action.

It should look something like this:

![Screen Shot 2023-01-17 at 11.35.20 PM.png](https://community.atlassian.com/t5/image/serverpage/image-id/234984iB992934BADB64AE8/image-dimensions/288x528?v=v2 "Screen Shot 2023-01-17 at 11.35.20 PM.png")

comments: author: Darren
body: thanks [@Darryl Lee](/t5/user/viewprofilepage/user-id/1365322)

OK, I see. So it appears we can't 'create issue' then 'transition issue' within the same rule without something inbetween to help it along.

Good answer, I'll give that a go and let you know how I get on - thanks!


author: Darren
body: Out of interest, [@Darryl Lee](/t5/user/viewprofilepage/user-id/1365322) , whilst we're here: do you happen to know where the Automation Audit Log is stored? I'm asking because I can seacrh it only by date: on a system that has a lot of rules firing and people not putting very descriptive names for their rules, it's quite time-consuming to track down the rule in question. If I know where the Audit Log is stored then I'll see if I can at least search by both date \& time as well as the issuekey to help me find the rules faster.


author: Darryl Lee
body: Hey [@Darren](/t5/user/viewprofilepage/user-id/618068) - you got it. The 'transition issue' rule needs to know what issue you want to act upon.

So with a scheduled trigger (which doesn't specify an issue, unlike other triggers), if you don't put it within the branch like I specified, it doesn't know *which*issue you want to transition.

As for finding logs for a specific rule, when you open a Rule for Editing, if you look beneath **Rule details** you'll see **Audit log.**This is a filtered view of the Log scoped to just this rule.

When I'm debugging a rule, I will typically leave the Edit screen up after Publishing changes, so I can quickly view and/or refresh the **Audit log** after testing.

There's a great HOWTO on doing this here:

* [Debug an automation rule](https://support.atlassian.com/cloud-automation/docs/debug-an-automation-rule/)


author: Darryl Lee
body: Hey [@Darren](/t5/user/viewprofilepage/user-id/618068) - after testing if you find that the branch rule did the trick, could you please click the green "Accept answer" button up there? Thanks.

BTW if you didn't want to wait until Feb 14 to see if this rule does the job of creating and transitioning, as the Debugging tips above suggest, you could temporarily replace the Scheduled trigger with a Manual one. I use this *all the time.*