Hello Community,
I need help with the creation of automation rules.
Problem: After migrating to Jira Cloud, the “Scheduled Issues” feature is no longer available.
Requirement: Jira issues must be created automatically. For example, an issue must be due on the second and last Monday of each month. The next issue must be created one day after the previous issue’s due date, regardless of the previous issue’s status.
New Jira automation rules with one due date per month appear to work correctly. However, in the example above, which has multiple due dates per month, the rule has not created any issues on the expected dates. So far, neither Rovo nor Copilot has been able to provide a solution.
How should the Jira automation rule be configured to meet the requirement above and create the issues on the required schedule?
Hi Stefanie,
Before you spend time on the JQL that was suggested, I'd say it won't do what you need here, because the trigger's JQL isn't a date gate at all. The docs put it plainly: "You can also choose to enter a JQL query. If you do, actions in this flow will execute on the work items included in the query." Since your rule creates a work item rather than acting on ones it finds, adding a query there would generally make it fire once per matching item instead of once on the right day.
Gor has already put his finger on the actual mismatch, and I'd fix that first: your conditions compare {{now}} against the second or last Monday, so the trigger itself has to land on a Monday for those comparisons to have any chance of matching. A cron of 0 0 9 ? * MON on the Scheduled trigger fires every Monday at 9am, and your existing lastOfTheMonth and ofTheMonth expressions then decide which of those Mondays actually creates something.
That keeps you at one rule per task, which I think was your real constraint, rather than a copy per date.
Which day is your trigger set to at the moment?
Hi @Troth_ Stefanie
Welcome to the Atlassian Community!
I’d handle this with one Scheduled Automation rule instead of maintaining multiple cron expressions.
Configure the trigger to run every day at your preferred time, then use date conditions to decide whether today is one of the required dates.
Jira Automation date smart values support the followint
{{now.ofTheMonth(2, 1).jiraDate}} -- second Monday of the current month {{now.lastOfTheMonth(1).jiraDate}} -- last Monday of the current month
So you can compare: {{now.jiraDate}} against those two values.
Your rule can then be structured like this.
Scheduled trigger
If/else condition
If: {{now.jiraDate}} = {{now.ofTheMonth(2, 1).jiraDate}} -- Create work item
Else if: {{now.jiraDate}} = {{now.lastOfTheMonth(1).jiraDate}} - Create work item
If you also need the next work item created one day after the previous due date, you can add another condition for the day after: {{now.jiraDate}} = {{now.ofTheMonth(2, 1).plusDays(1).jiraDate}} and similarly: {{now.jiraDate}} = {{now.lastOfTheMonth(1).plusDays(1).jiraDate}}
Find the smart value documentation here.
https://support.atlassian.com/cloud-automation/docs/jira-smart-values-date-and-time/
Regards,
Gor
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Gor Greyan ,
That is exactly what we did:
Due Date Issue 1: {{now.lastOfTheMonth(1).jiraDate}}
Due Date Issue 2: {{now.plusMonths(1).ofTheMonth(2,1).jiraDate}}
And it's not working. Nothing happend at the 01.09.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Troth_ Stefanie
Your scheduled trigger is currently configured to run on Tuesday, but your conditions are checking whether {{now}} is the second or last Monday.
When the rule executes on Tuesday, those comparisons will always be false. I would simplify the rule and schedule it to run daily.
Then use the two conditions -- Second Monday: {{now.jiraDate}} equals {{now.ofTheMonth(2,1).jiraDate}}
Last Monday -- {{now.jiraDate}} equals {{now.lastOfTheMonth(1).jiraDate}}
For the work item created on Monday, you can set its Due date directly to {{now.jiraDate}} If the requirement is that the next work item is created one day after that Monday, add another condition for Tuesday, rather than using plusDays(1) only for the Due date.
I would also add a Log action temporarily to output {{now.jiraDate}}, {{now.ofTheMonth(2,1).jiraDate}}, and {{now.lastOfTheMonth(1).jiraDate}}. This will make it very easy to verify what Jira is calculating.
Regards,
Gor
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Gor Greyan Thanks for your reply. The work items have to be created on TUE, one day after the due dates (the 2nd and the last monday of a month) of the previous work item.
When you say, the conditions refer to "Monday", should I change them to:
Second Monday: {{now.jiraDate}} equals {{now.ofTheMonth(2,2).jiraDate}}
Last Monday: {{now.jiraDate}} equals {{now.lastOfTheMonth(2).jiraDate}}
?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Troth_ Stefanie
Thanks for the clarification.
In that case, keeping the rule scheduled for Tuesday is correct. You should not change (2,1) to (2,2). Instead, check whether today is one day after the required Monday.
Tuesday after the second Monday is the following -->
{{now.jiraDate}} equals {{now.ofTheMonth(2,1).plusDays(1).jiraDate}}
Tuesday after the last Monday --> {{now.jiraDate}} equals {{now.lastOfTheMonth(1).plusDays(1).jiraDate}}
Then create the work item under each condition.
Regards,
Gor
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Gor Greyan Thanks for your suggestion, but this is exactly the setting, we tried at the beginning without success. I guess ".plusDays(1)" is the problem.
We changed the setting now as I said before. If the work item is still not generated, we'll simply clone them in the future. It's much more secure, as having an automation, which doesn't work.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
On Tuesday, 1 September, {{now.lastOfTheMonth(1)}} calculates the last Monday of September, while the Monday you actually want to check is 31 August.
A safer approach I think is to evaluate yesterday and check whether yesterday was the second or last Monday of its own month.
Tuesday after second Monday {{now.minusDays(1).jiraDate}} equals {{now.minusDays(1).ofTheMonth(2,1).jiraDate}}
Tuesday after last Monday {{now.minusDays(1).jiraDate}} equals {{now.minusDays(1).lastOfTheMonth(1).jiraDate}}
This also handles cases where the last Monday is on the final day of the previous month, such as 31 August → 1 September.
So your Tuesday schedule can stay as it is; I would just change the conditions to check yesterday rather than adding one day to a Monday calculated from now.
Regards,
Gor
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
The simplest might be to create three copies of the same rule and attribute them to the three required dates.
Another way could be to run the rule every workday and then use a JQL condition to have it executed only for those dates that fit your requirements.
Both solutions will count against your monthly rule execution limit only three times a month.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
We want to keep one rule per task. Descriptions etc change from time to time and we don't want to adjust more than one rule every time.
We set the trigger for the relevant day, but the conditions if/else/when.... don't generate any issues at the expected days.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Perhaps you could copy-paste your rule here so that it seems clearer what you try to do. The problem may also be elsewere. If an otherwise correct rule does not create an issue, that might also be because in the user rights, the role 'atlassian-addons-project-access' has no right to create issues. You might want to check the user rights scheme associated with the space.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Rules with one due date per months are working fine, so the rights are not the problem.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
That's the rule
Due Date Issue 1: {{now.lastOfTheMonth(1).jiraDate}}
Due Date Issue 2: {{now.plusMonths(1).ofTheMonth(2,1).jiraDate}}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I was rather thinking of a JQL condition directly in the trigger itself, without all the different if/then/else conditions. You can add that at the bottom of the trigger's properties.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I've found it. And how should this JQL condition looks like? I have no idea.... Can you give me the condition, so that we can try that instead of if/then/else?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I would have to look it up myself so I have to bail out on that, sorry.
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.
You could also trigger the rule and use if / then / else to
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
It's completely gone? That shouldn't be happening. Trigger is also called Scheduled now, not the Scheduled issues - just FYI.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes, it's gone. We should use the automation rules instead. There is a trigger type "scheduled" but we haven't been able to find out, how they work. To be honest, they are quite complicated, especially with more than one due date per month.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
@Troth_ Stefanie the functionality stays the same as the previous one. You have two sections:
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
We tried, but it is not working.
Requirement: Jira issues must be created automatically. For example, an issue must be due on the second and last Monday of each month. The next issue must be created one day after the previous issue’s due date, regardless of the previous issue’s status.
From August to September we had a switch to another month. Whatever we tried, nothing happend.
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.