How to see which user transitioned an issue from an automation rule

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

When using Automation for Jira rules to perform actions against issues in Jira Data Center, a user may want to narrow down which user performed a transition and the rule it used.

This can be useful for those users who see issues that transition that they didn't expect and the expected automation rule's audit log may also be missing a record of the event.

Solution

One way to perform this is to retrieve the issue key of the ticket you'll be searching for and use the following URL:

1 https:/serverName/rest/api/latest/issue/<issueKey>?expand=changelog

This will return a JSON output of all activity made against the issue to help narrow down the transition time.

If we take a look at the JSON and focus on the day of the status change, we can find the time here:

1 2 3 4 https://serverName/secure/useravatar?size=medium&ownerId=admin&avatarId=1"}, "displayName":"admin","active":true,"timeZone":"Etc/UTC"},"created":"2023-08-15T17:30:21.895+0000","items": [{"field":"resolution","fieldtype":"jira","from":null,"fromString":null,"to":"10000","toString":"Done"}, {"field":"status","fieldtype":"jira","from":"10000","fromString":"To Do","to":"10001","toString":"Done"}],"historyMetadata":{}}]}}

In the JSON output above, the "fromString":"To Do" switch to "toString":"Done" indicates the transition for the issue searched for, and the user as "displayName".

With this information, this can then be combined with what Jira's database shows when the issue was transitioned by following the steps listed in this KBA:

"The purpose of this article is to show how to get a list of all the issue status transition from database in JIRA. The status transition can be seen at the "History" tab of the issue.

This article will help on getting a list of all issue status transition of all issues in JIRA by executing a SQL command against the JIRA database."

Here's the example PostgreSQL query provided with an added call to also include the issue id and issue key:

1 2 3 4 5 6 7 8 9 10 11 12 13 SELECT changeitem.oldstring, changeitem.newstring, changegroup.author, changegroup.created, changegroup.issueid, p.pkey || '-' || i.issuenum as issue_key FROM changeitem JOIN changegroup ON changeitem.groupid = changegroup.id JOIN jiraissue i ON changegroup.issueid = i.id JOIN project p ON i.project = p.id WHERE changeitem.field = 'status' ORDER BY changegroup.created DESC;

oldstring

newstring

author

created

issueid

issue_key

To Do

Done

admin

2023-08-15 17:30:21.895+00

10008

SCRUM-9

This can then be combined with the following PostgreSQL query against the Automation for Jira rule's audit table to confirm the time and user:

1 2 3 SELECT "CATEGORY","AUTHOR_KEY","START_TIME","END_TIME","EVENT_SOURCE","OBJECT_ITEM_ID", "OBJECT_ITEM_NAME" FROM public."AO_589059_AUDIT_ITEM" ORDER BY "CREATED" DESC

CATEGORY

AUTHOR_KEY

START_TIME

END_TIME

EVENT_SOURCE

OBJECT_ITEM_ID

OBJECT_ITEM_NAME

SUCCESS

admin

2023-08-15 17:30:21.81

2023-08-15 17:30:22

jira.issue.event.trigger:commented

2

Transition

Updated on July 11, 2024

Still need help?

The Atlassian Community is here for you.