Jira REST API Audit Logs: AssociatedItems Name Field Shows IDs Instead of User Names

Nihar Markana _C_ December 9, 2024

 

Hi Team,

We are using the REST API: [link] to collect the Audit Logs of Jira Cloud.

During data collection, we noticed that some events (e.g., "User added to group," "User removed from group," etc.) include IDs in the name field of the associatedItems field instead of the actual names of the users on whom the actions were performed.

 

{
"id": 123456,
"summary": "User removed from group",
"created": "2024-12-09T06:24:37.645+0000",
"category": "group management",
"eventSource": "",
"objectItem": {
"name": "new-group",
"typeName": "GROUP",
"parentId": "2",
"parentName": "com.atlassian.crowd.directory.IdentityPlatformRemoteDirectory"
},
"associatedItems": [
{
"id": "ug:123ec4f5-a678-912b-34d5-6788123e4ada",
"name": "ug:123ec4f5-a678-912b-34d5-6788123e4ada",
"typeName": "USER",
"parentId": "1",
"parentName": "IDP Directory"
}
]
}

Is there any possible solution to retrieve the actual name in the raw event itself, instead of the ID in the name field, while collecting the audit log through the mentioned API?

1 answer

0 votes
Luiz Ricardo Pereira da Silva
Contributor
January 15, 2025

Hello @Nihar Markana _C_,

The REST API for these events will indeed return only the IDs, with the action's author being the only one returned by name.
As a workaround, consider adding the IDs to variables, if possible.

If the goal of these events, such as adding a user to a group, is to identify the user, this variable will help you perform another REST API call:

 

https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-users/#api-rest-api-3-user-get

 

Using the result from the first REST API call, you can retrieve additional user details, such as names or other relevant information.

Let me know if this approach helps or if you have any questions—feel free to reach out!

Best regards,

Nihar Markana _C_ January 16, 2025

Hi @Luiz Ricardo Pereira da Silva , Thanks for taking this up.

We can use the mentioned API as a 2nd REST call, but the problem with that is we are not receiving the accountID in audit logs every time. for example it might contains the authorKey (i.e, ug:123ec4f5-a678-912b-34d5-6788123e4ada) which is deprecated from the Jira. 

"associatedItems": [
{
"id""ug:123ec4f5-a678-912b-34d5-6788123e4ada",
"name""ug:123ec4f5-a678-912b-34d5-6788123e4ada",
"typeName""USER",
"parentId""1",
"parentName""IDP Directory"
}
]

So how can we get the user details with the user authorKey instead of the user accountID ?
Nihar Markana _C_ January 27, 2025

Hi @Luiz Ricardo Pereira da Silva  Do we have any updates on this ?

Nihar Markana _C_ February 18, 2025

Hi @Luiz Ricardo Pereira da Silva  Do we have any updates on this ?

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events