How to change username in Jira ?

Philippe Leménager
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 27, 2012

Hello,

My first question has been solved but adding the Internal with LDAP Authentication User Directory could dupplicate some real users with two usernames.

Indeed, our first application was open to external users but managed by some internal users and their accounts have been created sometime with a different username than the uid they have in our LDAP.

Now, I wish to change username and directory of these internal users to the right LDAP uid and affect them in the Internal with LDAP Authentication User Directory.

I've explored the database and unfortunately there are many tables that use username instead of using foreign key referencing cwd_user.ID.

Is there a possibility to change username via Jira interface or do I have to develop a script to change usernames in all the database tables they figure ?

3 answers

1 accepted

3 votes
Answer accepted
Sean Rich September 27, 2012

Jamie Echlin's excellent scriptrunner plugin (https://marketplace.atlassian.com/plugins/com.onresolve.jira.groovy.groovyrunner) includes a script to rename users.

Philippe Leménager
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 30, 2012

Thank you John for your indication. This plugin is already installed on my Jira server and it works well !

Now, I need to change the directory of the users that I've changed their username to move them in the "Internal with LDAP Authentication User Directory".

Lokking in the database shows it's the same problem : directory_id is indicated in more than one table.

I can't see a similar function in the plugin or elsewhere in Jira admin interface. Does it exists ?

Like Leif Claßen likes this
2 votes
JohnA
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
September 27, 2012

Hi Philippe,

The only way to change usernames in JIRA is to export the data to XML format, open it in an editor and then use Find & Replace to manually change all the instances of the username in the XML. After that you can then restore the XML data again and the usernames will have been changed. However, this isn't really recommended, (even though it generally works), so please try it first in a test environment before deploying it to production.

All the best,
John

0 votes
Alejandro Conde Carrillo
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
January 31, 2013

You could also create a new username and bulk change all issues assigned/reported by the old user to the new one, as explained in Changing usernames in JIRA.

Nabil Sayegh
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 23, 2013

The link is dead.

And unfortunately it's not done with bulk changing the issues. There are filter, dashboards, history, ...

Like Jelena Jelic likes this
David at David Simpson Apps
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
June 26, 2013

@Nabil Sayegh try: https://confluence.atlassian.com/display/JIRA051/Changing+Usernames+in+JIRA

Or upgrade to JIRA 6 - JRA-1549 has been resolved ;)

Suggest an answer

Log in or Sign up to answer