Wrong user_name reference when renaming username


I have the following problem when renaming a username for an existing user.

I have created a new user, for instance username 'torben.ulrich@xyz.de' and email also 'torben.ulrich@xyz.de'.

After that I created issues where this user torben.ulrich@xyz.de is the ASSIGNEE.

Then I renamed the username from 'torben.ulrich@xyz.de' to tUlrich.

The table in SQL Server database dbo.cwd_user is showing the correct value in the field user_name: tUlrich

The problem now is, that the user is renamed correctly, but new and existing issue still have the first username 'torben.ulrich@xyz.de' in a user field, for instance ASSIGNEE in the table jiraissue.

The table dbo.jiraissue still has the wrong value in the field ASSIGNEE: torben.ulrich@xyz.de.

My question now is, how can I correct this field (reference) in dbo.jiraissue?



1 answer

1 accepted

1 vote

You are not expected to be able to change this field in the jiraissue table.  Actually the value in the jiraissues table is correct.   I understand why you might believe it to be wrong, but that is because of the way Jira is tracking user account renames.

Jira tracks a user account being renamed inside the app_user table.   When an account is first created in Jira the user_key field is set to match the cwd_user.user_name value.   However after this account is first created, that user_key field is never expected to change in the Jira database.  Regardless of whether or not the username changes, that user_key remains constant for that particular user account.  Instead the app_user.lower_user_name value can change to correspond with the changes in cwd_user table when the user gets renamed, but there are several places within Jira that do not directly refer to the cwd_user table for the user account.  Instead Jira is primarily looking at the app_user.user_key entry for historical records such as which user updated an issue, or executed a transition.   This can also be seen when you look at the issue details view in Jira, if you click on the history tab, this view shows the app_user.user_key field for a username, and not the cwd_user.user_name field.

This way Jira can keep track of historical changes that take place through a specific account, even if that account's name changes over time.  

As such I would not recommend trying to change this value in the database, but rather, it is better to refer to the app_user table to understand which account is really being used here.

Does this help?

If not, please let me know more about what exactly you are trying to achieve through SQL and perhaps I can offer another solution here.


Thanks for the reply, that helped in my case. We have an internal dashboard with incident issue assigned to users. We have to load the user information from a different source and the world we'll be fine again.

Suggest an answer

Log in or Join to answer
Community showcase
Emilee Spencer
Published Friday in Marketplace Apps

Marketplace Spotlight: DeepAffects

Hello Atlassian Community! My name is Emilee, and I’m a Product Marketing Manager for the Marketplace team. Starting with this post, I'm kicking off a monthly series of Spotlights to highlight Ma...

57 views 0 3
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot