How to determine the automation rule that updated an issue
Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.
Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Summary
This guide will provide a SQL query that can help to identify which automation rule is executing to update an issue.
Solution
The rule execution information is stored within AO_589059_AUDIT_ITEM table. This is where the success/failure messages come from within the Automation for Jira Audit logs. The actual object that the automation run executed upon is listed within the AO_589059_AUDIT_ITEM_ASC_ITEM table. So the query below will join these tables to show you the outcome of the rule and the rule that actually executed on a given ticket:
1
2
3
4
5
6
7
8
9
10
11
SELECT
ai."CATEGORY" AS "Rule Result",
ai."CREATED" AS "Rule Execution Time",
ai."OBJECT_ITEM_NAME" AS "Rule Name",
ai."SUMMARY" AS "Rule Summary",
aiai."NAME" AS "Object Name",
aiai."TYPE_NAME" AS "Object Type"
FROM public."AO_589059_AUDIT_ITEM" ai
INNER JOIN public."AO_589059_AUDIT_ITEM_ASC_ITEM" aiai
ON ai."ID" = aiai."AUDIT_ITEM_ID"
WHERE aiai."NAME" = '<issue key, ex: TEST-4>';
Important Note:
You will need to replace the <issue key, ex: TEST-4> with the actual issue key you would like to search.
This is written for Postgres, so it might need some adjustment for your database platform.
Depending on how old the ticket is and how many automation rules could have potentially executed on this ticket you may want to add a date constraint to this using the ai."CREATED" column. The query in its current form will return all rules that have ever executed on the ticket as many times as they have executed on the ticket. This could potentially return a lot of data so caution should be exercised here.
Was this helpful?