Is it possible to put more than one Cron-Expression in one Automation Rule?
Hi @Troth_ Stefanie
Welcome to the Atlassian Community!
You can achieve this with one automation rule, but not by adding two separate CRON expressions to the same Scheduled trigger.
As you need the work item created at 08:00 on the second Monday and the last Monday of every month, I would configure the rule to run every Monday at 08:00, and then add an If/else condition to continue only when today is the second Monday of the month, or the last Monday of the month.
Date smart values are available specifically for this
{{now.ofTheMonth(2, 1).jiraDate}}
This returns the second Monday of the current month
{{now.lastOfTheMonth(1).jiraDate}}
returns the last Monday.
You can therefore compare {{now.jiraDate}} against those values and create the work item when either condition matches.
More smart values you can find here
https://support.atlassian.com/cloud-automation/docs/jira-smart-values-date-and-time
Regards
Gor
Thank you for your answer. That was very helpful! Just one more question. Can I check the "upcoming executions" somewhere, as in the old version? I would like to check, that I did everything correctly.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Troth_ Stefanie
For the Crone Expression, it doesn't provide Upcoming Execution, but for the Basic one, it is available.
If you need Crone, for Every Monday at 09:00, you can use this.
0 0 9 ? * MON *
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I just want to check, if the Issues will be created correctly. And I can't use the basis trigger, because there are more than one occurences (due dates = 2. Monday and last Monday per month and creation of the issue one day after the due date of the previous one). I already edited the automation rule, know I want to check, if the results are correct.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
In that case, unfortunately, Jira Cloud Automation doesn't provide a native preview of future executions/results before the rule actually runs. For testing, I would temporarily clone the rule, replace the Scheduled trigger with a Manual trigger, and use Log actions to output the calculated dates instead of creating the work items. This lets you verify the second Monday, last Monday, and your calculated due dates without creating real issues.
Once the values look correct, you can keep the production rule scheduled for every Monday at 09:00.
Regards,
Gor
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks. Meanwhile I integrated "Protokollaktionen" and checked the AuditLog (with help from CoPilot).. The flow couldn't be executed because today is not one of the expected days as shown in the message. So everything looks good and I'll try it that way. Thanks al lot for your help!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Dear @Troth_ Stefanie
Great!
Also, if the solution help you, kindly ask you to accept the answer, as other community members see it as resolved :)
Have a nice day!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Not technically but you should be able to club more occurrences into one cron. What challenge do you face?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, JIRA was just migrated into the cloud version. And now we have to create all the old "scheduled issues" new. One Scheduled Issues had 2 Cron-Expressions: ""0 0 8 ? * 2#2" und "0 0 8 ? * 2L". The Tickets should be generated at the 2nd and the last Monday of a month. Is there any chance to create 1 Automation Rule with these two conditions?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Ja not very straight forward for a simple cron
@Gor Greyan gave the approach to handle this.
Basically set the cron for every monday -> 0 0 9 ? * MON
and add a compare condition like below:
first value => {{#and(now.dayOfWeek.equals("Monday"), or(now.dayOfMonth.isBetween(8, 14), now.plusDays(7).month.value.isAfter(now.month.value)))}}true{{/}}
condition => equals
second value => true
in the section below
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.