Uploaded image for project: 'Jira Data Center'
  1. Jira Data Center
  2. JRASERVER-67213

[GDPR compliance] Changing User Name Does Not Update Mentions [~name] in Description and Comments

      Summary

      Due to the new GDPR compliance requirement, we are required to change user name. But, changing user name did not update mentions name in description and comments

      Environment

      JIRA Version : Tested on JIRA 7.9

      Steps to Reproduce

      1. @Mention some name in Comment or Description
      2. Update user name to a new name
      3. Check the ticket for the mention, it will show old username being mention

      Expected Results

      1. Mentioned name update accordingly

      Actual Results

      1. Mention does not update, it still using old username at mention in comment and description

      Workaround

      1. Update all the old username to new username from jiraaction table
        UPDATE [jiradb7.8.1].dbo.jiraaction SET actionbody = '[~myNameToUpdate]' WHERE cast(actionbody as nvarchar(max)) = '[~NewName]'
        

          Form Name

            [JRASERVER-67213] [GDPR compliance] Changing User Name Does Not Update Mentions [~name] in Description and Comments

            Hi all,

            you may have a look on this two GDPR-AddOns. With this AddOns you will be able to be fully compliant to the GDPR-Policies.

            Best Regards
            Domenico

            Domenico Manzo [Actonic] added a comment - Hi all, you may have a look on this two GDPR-AddOns. With this AddOns you will be able to be fully compliant to the GDPR-Policies. JIRA:  https://marketplace.atlassian.com/1218962 6 Confluence:  https://marketplace.atlassian.com/1219041 3 Best Regards Domenico

            I agree this is an issue.  We are also migrating from using a simple username to using the full email address as the username.  This would require a script to loop through 600+ accounts to change the mentions accordingly.  Is this the only table which has these mentions?  I think the description could also contain mentions.  Is there any other location where a username is not updated correctly during the "supported" username change?

            Adam Barylak added a comment - I agree this is an issue.  We are also migrating from using a simple username to using the full email address as the username.  This would require a script to loop through 600+ accounts to change the mentions accordingly.  Is this the only table which has these mentions?  I think the description could also contain mentions.  Is there any other location where a username is not updated correctly during the "supported" username change?

            The older issues JRASERVER-35102 and JRASERVER-40847 requested the same thing.

            Are the names the wrong way around in the workaround SQL? Assuming myNameToUpdate is the original name of the user, I'd expect this instead:

            UPDATE [jiradb7.8.1].dbo.jiraaction SET actionbody = '[~NewName]' WHERE cast(actionbody as nvarchar(max)) = '[~myNameToUpdate]'

            jira1167065457, the workaround SQL is valid syntax for Microsoft SQL Server. I'm not too familiar with MySQL but it might work if you just omit the cast, i.e. WHERE actionbody = 'myNameToUpdate'. Try in a test instance first.

            Kalle Niemitalo added a comment - The older issues JRASERVER-35102 and JRASERVER-40847 requested the same thing. Are the names the wrong way around in the workaround SQL? Assuming myNameToUpdate is the original name of the user, I'd expect this instead: UPDATE [jiradb7.8.1].dbo.jiraaction SET actionbody = '[~NewName]' WHERE cast (actionbody as nvarchar( max )) = '[~myNameToUpdate]' jira1167065457 , the workaround SQL is valid syntax for Microsoft SQL Server. I'm not too familiar with MySQL but it might work if you just omit the cast, i.e. WHERE actionbody = ' myNameToUpdate ' . Try in a test instance first.

            I tried using
            UPDATE jiraaction SET actionbody = 'NameToUpdate' WHERE cast(actionbody as nvarchar(max)) = 'NewName';
            but I get an error: ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'nvarchar(max)) = 'NewName'' at line 1

            Christian Röhl added a comment - I tried using UPDATE jiraaction SET actionbody = ' NameToUpdate ' WHERE cast(actionbody as nvarchar(max)) = ' NewName '; but I get an error: ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'nvarchar(max)) = ' NewName '' at line 1

              Unassigned Unassigned
              dkoh Danson (Inactive)
              Affected customers:
              5 This affects my team
              Watchers:
              11 Start watching this issue

                Created:
                Updated: