Overview
You, as a Jira admin may face with an issue that it is not possible to delete all the user related data if user were deleted, and in some cases, if user were disabled.
To solve this problem you can use “Data Cleaner” module from the “GDPR and Security app” for Jira.
How to anonymize “Display Name”, “Email”, “User Name”
It is possible to anonymize any text field and replace information about disabled / deleted users using custom templates. It will work only for text fields. For it, administrators should create a custom template and then create a number of rules to replace user names, display names, and e-mail address.
1. Click on the “Create custom template” button
2. Fill all necessary fields, like Template name, Scope and Fields.
3. Go to the “Data Processing Rules” tab and using “Create new rule” dialog create 3 rules.
Do the same for Display names and E-mail address.
After creating of all rules, an administrator should have something similar:
(all “Search type” fields should have “Plain text” type)
How to anonymize all the User picker fields
The first workaround will help to search / anonymize disabled / deleted users only for text fields, but if you need to find user in the user fields (like assignee, reporter, etc.) you should do one more step. Unfortunately because of the limitations of the Jira REST API, you could not use the same “Data Processing rule” dialog to create a special rule for users, just because you can’t choose user in the user picker, but it is possible to use our API to create rule due to special Rest Call. Please execute the next JavaScript in the browser console with the correct parameters.
let templateId = 1; // Here should be your template id let userMap = {"yoursourceusername":"yourtargetusername"}; // it is map of the changes "sourceUser" -> "targetUser", it is possible to specify a few number of users here let serverUrl = "https://your.server.url.com/contextPathIfExists"; // Your server url console.log("Starting..."); let success = 0; let error = 0; let link = serverUrl + "/rest/actonic-gdpr/1.0/data-cleaner-template/rules"; Object.keys(userMap).forEach((key) => { console.log("> creating rule for '" + key + "' -> '" + userMap[key] + "'"); let sourceUser = key let targetUser = userMap[key] let data = { templateId: templateId, name: sourceUser + " -> " + targetUser, enabled: true, replaceType: "user", searchType: "user", searchString: sourceUser, replaceString: targetUser } $.ajax({ url: link, method: "PUT", async: false, headers: { "Content-Type": "application/json" }, data: JSON.stringify(data), success: function (data) { console.log(">>> ...created (" + JSON.stringify(data) + ")") success++; }, error: function (xhr) { console.log("> !! FAILED for '" + sourceUser + "' -> '" + targetUser + "', reason: (" + xhr.status + ") " + xhr.statusText); error++; } }) }); console.log("Finished!"); console.log("Created rules : " + success); console.log("Failed create : " + error);