Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Automation for cleaning tickets

Dominic Peters
Contributor
July 23, 2025

Hi Community!

im a Site-admin and try to create an automation for my customer that do "things" when time is gone.

We need 2 automations. The first one should check every day at 9 o`clock if tickets are not updated more then 30 days and add a comment "WITH TEXT" and another automation that triggers every day at 8 o`clock (we do this to secure an order of the automations and they dont start at the same time). This automation should check if tickets are not updated more than 44 days then add a comment "WITH another TEXT" and transistion the issue to resolved.

It sounds simple but it doesnt work. Sometimes we get 2 comments of the same automation on a ticket. We tryied to use the following JQL for the Automations:

 

1.  project = "Project 1" AND Status = "In Progress" and updated <= -30d 

2. project = "Project 1" AND Status = "In Progress" and updated <= -44d 

 

But it doesnt really work, because the second automation is never triggered. How could we do this, has anybody experience with an automation builds like this?

I am very thankful vor any tips

 

3 answers

1 vote
Usman
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
July 23, 2025

Hello @Dominic Peters 

Your JQLs are:

project = "Project 1" AND Status = "In Progress" and updated <= -30d
project = "Project 1" AND Status = "In Progress" and updated <= -44d

Why the 44-day rule (second automation) is not triggering: JQL Overlap

Both automations use similar criteria, but a ticket that has not been updated in 44+ days will match the 30-day rule as well as the 44-day rule.

If the 30-day rule runs first and adds a comment (which is an update), the "updated" date is changed. When the 44-day rule runs an hour later, the ticket's "updated" date is too recent (<44 days), so it no longer matches and is skipped.

Why you are getting duplicate Comments

If issues match the JQL each day and are not updated by anything other than this automation, automation will continue to add a comment every day because the comment itself is an update. (Depending on how quickly Jira's "updated" field is set and whether your automation "repeats," this could cause double or repeated comments if rule or scheduling problems exist.)

What you can do here: JQL Improvements

For first automation (30 days), exclude any tickets untouched for 44 or more days:

project = "Project 1" AND Status = "In Progress"
AND updated <= -30d AND updated > -44d

This ensures only tickets aging between 30 and 44 days receive the first comment.

For second automation (44 days), keep as is:

project = "Project 1" AND Status = "In Progress"
AND updated <= -44d

Now, the same ticket cannot be picked up by both rules on the same run.

If you only want to comment once at each threshold, the above JQLs suffice. The first rule updates "updated" date at day 30 (with a comment), so the issue will only move into the 44-day JQL 44 days after the last update, not the first comment.

Recommendations:

Make sure your automations aren't running so close together that the first rule hasn't finished processing before the second starts. Running one at 8:00 and one at 9:00 is typically sufficient, but issues with Jira's background job timing could still cause conflicts.

Jira's automation audit logs show if/when a rule was triggered and what issues were affected. Use this to confirm that each rule only triggers as expected, and that each ticket is processed only once per rule.

 

 

0 votes
Oleksii Melnyk
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 23, 2025

Hi @Dominic Peters !

Can you share all your rules?


Try to turn on the option "Only include issues that have changed since the last time this rule executed". This ensures the rule only processes issues that have actually changed (e.g., been updated) since the previous daily run, preventing re-processing and duplicates.

Also, is it important for you to track updates or the number of days the status has not changed?

0 votes
Yogesh Mude
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
July 23, 2025

@Dominic Peters To get this done what you can do is when the First time the comment added then you can update the label field with first or something else and the label field value you can check in the second automation. If the label is there as first then dont add the comment with another text.

I was gone thru this kind of automation and the users wants to have the strike rule to be implemented for alternate days.

Feel free to share the automation rule snap and the detaisl and im happy to help you here.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
ENTERPRISE
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events