Is there an API available to fetch information regarding actor when issue get updated?
We can get creator of issue using 'get issue API' but when issue gets updated we do receive an actor in the response
Hi Sneha,
If I understand correctly, you are looking to find out which user made a change to a Jira Cloud issue via the API. The REST API can do this, but you tend to need to look closely at the history of the issue to determine this. When using the REST API this requires that you use the expand parameter and then specify changelog. This will return issue histories in a json format from which you can then look to see which user made which changes to the issue.
While the Get issue endpoint has this documented, I will share with you how I can find this via REST API call using curl. First I made a change to a particular issue (changed the component on an issue from having a value to having no components at all), then I made the following REST API call:
curl -D- -X GET -H "Authorization: Basic [redacted]" -H "Content-Type: application/json" "https://[mycloudsite].atlassian.net/rest/api/2/issue/SCRUM-64?expand=changelog"
This could return a large json response, especially if there have been lots of changes to an issue, but essential you can look through these to find an entry that has the change you are looking for, and then you should be able to see the user accountId and/or their display name:
"key":"SCRUM-64","changelog":{"startAt":0,"maxResults":2,"total":2,"histories":[{"id":"11257","author":{"self":"https://[mycloudsite].atlassian.net/rest/api/2/user?accountId=[redactedUserAccountId]","accountId":"[redactedUserAccountId]","avatarUrls":{...[redacted because they are not important to this example ...},"displayName":"Charlie","active":true,"timeZone":"America/Chicago","accountType":"atlassian"},"created":"2020-05-19T13:22:15.735-0500","items":[{"field":"Component","fieldtype":"jira","fieldId":"components","from":"10065","fromString":"asdfasdf","to":null,"toString":null}]}
In this response you can see that Charlie change the componet from an internal value of 10065 to null (which means the component has been removed). You can also see that there is an author value here that identifies that user's accountId, which would be a better means to correctly identify user accounts that make changes rather than just depending on the display name itself.
I hope this helps. Please let me know if you have any followup concerns here.
Andy
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.