-
Bug
-
Resolution: Unresolved
-
Low (View bug fix roadmap)
-
None
-
7.13.0, 8.4.0
-
7.13
-
29
-
Severity 3 - Minor
-
2
-
Description
When a user is added to a project role, when checking the Audit logs, this user is referred to by its "user key" instead of its username:
With the recent GDPR changes introduced in Jira 8.4, the user keys or newly created users have the format JIRAUSERXXXXX, which makes it impossible to know which users were added to a specific role from the Audit Logs. Instead, the Jira admin user needs to have access to the DB and query the app_user table to find the relationship between the user key and the user name.
Step to reproduce
- Install Jira 8.4 or any higher version
- Create a new user
- Add this user to any project role
- Go to the page ⚙ > System > Audit Logs
- Look for the entry corresponding to the addition of the user to a project role, and verify that the user key is displayed instead of the username
Suggestion
Instead of using user_key, the Audit Logs should show the username as it's more relevant to the users. Note that it's already the case when a user is added to a group (as shown in the screenshot below), so the Audit Logs should be consistent and show the username whenever some modifications is made to a user.
Workaround
You may leverage the following front-end based workaround, which upon loading the Project based or Global based audit logs, will dynamically look up and replace user keys with their user names. v3 has been tested on Jira 8.20.10 only, v3.1 only on 9.12.6. It might not work on other versions.
Installing
- Add the following script to Jira's Announcement Banner:
- For Jira 8.20 - JRASERVER-71189-v3.js
OR - For Jira 9.12 - JRASERVER-71189-v3.1.js
- For Jira 8.20 - JRASERVER-71189-v3.js
Theory of operation
- We place a script in Jira's announcement banner. It only loads on the Audit log pages
- When a user clicks on a button, the script check's if the row for the button is a "Project role changed" row. If it is, then it will find user keys within the audit entry, and individually sends a request to the server to obtain the user object for the keys listed
- The returned value from the server contains the username and the user key. The script finds all other occurrences to this user key within the Audit log page, and replaces them with the user key. This is a performance optimisation to avoid repeat lookups. It also marks the changed entries as modified, so entries already resolved won't get resolved again upon row expansion/contraction
- The script considers contacting the server as little as possible. For any given page of data, a user key is only requested once, even if it has multiple entries in the page. Data isn't loaded in bulk, so the maximum sequentially queued requests to the server is equal to the unique number of usernames within the row that was expanded
Limitations
- The script relies on a specific construction of the DOM, so changes between Jira versions may break the script. As such there is no guarantee it would work on a future version of Jira
- It does not fix the audit log REST API nor does it fix the export feature
- relates to
-
JRASERVER-68450 Issue history displays user key instead of username for reporter or assignee changes
-
- Closed
-
-
JRASERVER-61871 Improvement to show username instead of user_key in issue's history tab
- Gathering Interest
Form Name |
---|
A huge thanks to Alex from Premier Support who helped formulate the workaround javascript. I can confirm that this works in our very complex environment (8.20.x)
CCM