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

Strange behavior when updating usernames in Jira

XMLWordPrintable

    • 7.13
    • 89
    • Severity 2 - Major
    • 85
    • Hide
      Atlassian Update – 25 November 2024

      Hi everyone,

      We would like to provide an update regarding the issue reported concerning the detection of user renames in LDAP scenarios.

      After thorough investigation, we have determined that the behavior observed is consistent with the expected functionality in how the logic handles username collision. We do this to make sure that we do not loose any existing data connected to the old username.

      In the case described below:
      Step 2:
      Internal -> test
      LDAP -> tester

      Step 3:
      Internal -> test
      LDAP -> test (tester userkey becomes orphaned)

      Step 4:
      Internal -> test
      LDAP -> tester (tester from Step 2 has been renamed to tester#1 to make sure no previously associated work is lost)

      If you would like to recover the work of tester from Step 2, please follow the Workaround section.

      We will go ahead and close this bug. If you have any further questions, please feel free to reach out to our support teams

       

      Rudy Slaiby
      Product Manager - Jira Data Center

      Show
      Atlassian Update – 25 November 2024 Hi everyone, We would like to provide an update regarding the issue reported concerning the detection of user renames in LDAP scenarios. After thorough investigation, we have determined that the behavior observed is consistent with the expected functionality in how the logic handles username collision. We do this to make sure that we do not loose any existing data connected to the old username. In the case described below: Step 2: Internal -> test LDAP -> tester Step 3: Internal -> test LDAP -> test (tester userkey becomes orphaned) Step 4: Internal -> test LDAP -> tester (tester from Step 2 has been renamed to tester#1 to make sure no previously associated work is lost) If you would like to recover the work of tester from Step 2, please follow the Workaround section. We will go ahead and close this bug. If you have any further questions, please feel free to reach out to our support teams   Rudy Slaiby Product Manager - Jira Data Center

      Issue Summary

      When updating a user name in Jira such as naming a user in an LDAP as the same username as an internal user, this can cause some undesirable behavior if you choose to rename one of the users back to their previous/any other username. Similar to JRASERVER-36594.

      Steps to Reproduce

      1. Set up Jira to a connector LDAP directory.
      2. Create two users, test and testtester. One in the internal and the other in the LDAP directory.
      3. Rename the LDAP user to match the internal directory user. Jira will recognize this user as the same user since the name matches between directories.
      4. Rename the LDAP user back to their previous username(testtester) or any other username.

      Expected Results

      This will update the current record inside of Jira's app_user table so it recognizes the user as its previous user.

      Actual Results

      When you change the user back to their old username in LDAP so they don't match the internal users username, Jira creates an app_user record for a brand new user and then renames the historical record of the user name with a #1 behind it but nothing gets added to cwd_user so the relationship ends up being broken.

      Before Test

      app_user table:

      j890=# select * from app_user;
        id   |   user_key    | lower_user_name 
      -------+---------------+-----------------
       10000 | JIRAUSER10000 | admin
       10100 | JIRAUSER10100 | java
       10101 | JIRAUSER10101 | test
       10102 | JIRAUSER10102 | testtester
      (4 rows)
      

      After Test

      app_user table:

      j890=# select * from app_user;
        id   |   user_key    | lower_user_name 
      -------+---------------+-----------------
       10000 | JIRAUSER10000 | admin
       10100 | JIRAUSER10100 | java
       10101 | JIRAUSER10101 | test
       10102 | JIRAUSER10102 | testtester#1
       10103 | JIRAUSER10103 | testtester
      

      Notes

      This causes some undesirable behavior where the old user record cannot be interacted with in the GUI if they were an assignee of an issue before the username change. Example:

      Here, we can see the broken Assignee record in the JQL results. This user can be changed as the assignee but this shows the broken relationship between what's in the GUI compared to what's in the database since the link for the user between app_user and cwd_user gets broken.

      Workaround

      If you plan to rename an LDAP user to an existing user_name of the internal directory, the following steps can avoid this behavior:

      1. Disable the LDAP directory;
      2. Move the internal directory to the top of the list;
      3. Rename the internal users to something different;
      4. Rename the LDAP users to the target username;
      5. Enable the directory and move it back to the top of the list.

              21d451cf00e1 Dominik Wojtasik
              jsanchez2@atlassian.com Jeremy Sanchez
              Votes:
              8 Vote for this issue
              Watchers:
              27 Start watching this issue

                Created:
                Updated:
                Resolved: