Heads up! On March 5, starting at 4:30 PM Central Time, our community will be undergoing scheduled maintenance for a few hours. During this time, you will find the site temporarily inaccessible. Thanks for your patience. Read more.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Automation for Jira - Rule Expiry based on use

Matthew Martin
Contributor
January 27, 2025

We have a very large, scaled data center instance of Jira without over 1000 rules. While I appreciate that if a rule isn't being, it's not causing an impact on performance, I would like old configuration data that is not being used to be cleaned up.

I cannot see any mechanisms in Automation for Jira that exist to say:

  • Set rule deactivation based on use (e.g., if an active rule hasn't been used for 90 days, it's deactivated)
  • Set rule deletion based on use (e.g., if a rule hasn't been used for 180 days, it's deleted)
  • Set a notification that triggers ahead of deactivation/deletion to notify the owner

Unless there's another way to do these things, what we have to implement is either a manual-heavy process of investigating the audit logs associated with rules to identify their usage, and then act on them individually. This isn't something we can reasonably do.

How have other users gone about this assuming I'm not the only platform owner trying to stave off the unrelenting growth of data.

2 answers

1 accepted

3 votes
Answer accepted
Benjamin
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 27, 2025

Hi @Matthew Martin ,

 

I haven't seen a mechanism either. In cloud, there is a usage dashboard:

 

https://support.atlassian.com/cloud-automation/docs/view-your-automation-usage/

 

I see that you mention data Center. You can pull stats off the DB to get usage information you need in order to make informed decisions on which automation to deactivate or delete.

https://confluence.atlassian.com/automation/check-your-rule-statistics-with-queries-1141480665.html

A caveat to look for is that even though a rule is constantly triggered, doesn't mean is actively used. Issues may never hit the condition due to changes in project schemes setup. So, there are times that automation rules needs a deeper inspection.

 

Hope this helps.

 

 

 

 

Matthew Martin
Contributor
January 27, 2025

DC has a page for performance insights which is decent, but everything is lacking for managing broadly at scale. 

Thanks for the link to the page detailing how this could be produced through the database. Once again, having to design and implement a bespoke process for what should be done in the tool. :( 

It's incredibly frustrating that while Atlassian seems to be going the extra mile lately on stabilising their DC product, addon vendors that consider the management of the data generated in environments are still few and far between. I feel like I've submitted feedback to 5 separate vendors lately on how they should be improving their products. Sadly, little interest. 

Like Benjamin likes this
Benjamin
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 28, 2025

Agree. Definitely would be helpful to have. Possibly a shift to focus on cloud offerings.  

Matthew Martin
Contributor
January 29, 2025

Ahh yes - the "We are totally not abandoning the data center product" messaging with the follow up action of heavily prioritising their cloud products to the degree that data center effectively feels abandoned.

10/10

Like Benjamin likes this
0 votes
Layssa Souza
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.
January 29, 2025

Hi, @Matthew Martin 

 

Unfortunately, Automation for Jira (A4J) doesn't have a native mechanism to automatically disable or delete rules based on usage. However, there are some approaches you can take to manage this in an automated way.

1. Using ScriptRunner to Monitor Rule Usage
ScriptRunner can help analyze Jira audit logs and make decisions based on them. Here is an action plan that can be implemented:

Extract usage logs from automation rules

Automation for Jira maintains audit logs for each rule. You can access this via REST API or query the database (if allowed).
The logs contain timestamps of rule executions.
Create a script to identify inactive rules

If a rule was last run more than 90 days ago, the script can automatically disable it.
If the last run is more than 180 days old, the script may delete it.
Send notifications before deactivation/deletion

The script can send an email or notification via Slack/Jira to the rule owner, informing them that it will be deactivated/deleted in X days.

 

2. Jira REST API - Monitoring and Automation

Steps:
List all automation rules:

curl -u user:token -X GET "https://seu-jira.com/rest/atlassian-connect/1/addons/com.codebarrel.addons.automation"

Get the audit logs for a specific rule:

curl -u user:token -X GET "https://seu-jira.com/rest/atlassian-connect/1/addons/com.codebarrel.addons.automation/audit"

Automatically deactivate a rule via API:

curl -u user:token -X PUT -H "Content-Type: application/json" \
--data '{"enabled": false}' \
"https://seu-jira.com/rest/atlassian-connect/1/addons/com.codebarrel.addons.automation/rule/{ruleId}"

Automatically delete a rule via API (only if confirmed by the owner):

curl -u user:token -X DELETE \
"https://seu-jira.com/rest/atlassian-connect/1/addons/com.codebarrel.addons.automation/rule/{ruleId}"

 

I hope this can help you in some way

Best Regards.

 

Matthew Martin
Contributor
January 29, 2025

Thanks Layssa,

This is good information. I'll chuck it in the backlog.

Like Layssa Souza likes this

Suggest an answer

Log in or Sign up to answer