Details
-
Bug
-
Resolution: Answered
-
High
-
None
-
8.4.1
-
8.04
-
91
-
Severity 2 - Major
-
19
-
-
Description
Issue Summary
Existing mentions are shown with AccountID after backup is imported into Jira Server from Cloud.
Environment
Jira 8.4.1
Steps to Reproduce
- Mention a user in Jira Cloud, you should see their name on the mention once you save the comment.
- Generate a backup for Server and restore this to a Server instance
- Check the same issue you mentioned previously in Cloud
Expected Results
The Users name still present on the issue
Actual Results
The AccountID is shown instead:
Notes
- Related to changes made in Cloud due to GDPR:
- We see from the database that the AID is mapped to the username in the external_id column in Jira Server.
Workaround
This should give you a list of update queries to run, we recommend testing this in a lower enviornment and as always backing up the DB before running anything
PostgreSQL:
SELECT ('UPDATE jiraaction SET actionbody = replace(actionbody, ''accountid:' || cu.external_id || ''', ''' || cu.lower_user_name || ''') WHERE actionbody LIKE ''%[~accountid:' || cu.external_id || ']%'';') as "Queries to fix" FROM cwd_user cu WHERE cu.external_id IS NOT NULL;
MySQL:
SELECT (CONCAT('UPDATE jiraaction SET actionbody = replace(actionbody, ''accountid:' , ifnull(cu.external_id, '') , ''', ''' , ifnull(cu.lower_user_name, '') , ''') WHERE actionbody LIKE ''%[~accountid:' , ifnull(cu.external_id, '') , ']%'';')) as "Queries to fix" FROM cwd_user cu WHERE cu.external_id IS NOT NULL;
Workaround 2
We noticed that if you desire to change the email accounts of users, the queries above would fail to migrate the mentions correctly.
For the migration to be successful, we need to update the "actionbody" column with the "user_name" value and then change the email account of the user:
- Use the query below to generate the updates:
--QUERIES FOR POSTGRES SELECT ('UPDATE jiraaction SET actionbody = replace(actionbody, ''accountid:' || cu.external_id || ''', ''' || cu.user_name || ''') WHERE actionbody LIKE ''%[~accountid:' || cu.external_id || ']%'';') as "Queries to fix" FROM cwd_user cu WHERE cu.external_id IS NOT NULL;
- Run the generated queries.
- Update the user's email accounts.