Bulk modify usernames in JIRA

Do you know by any chance if there is another way to modify multiple users? For example I have multiple users that are firstname.lastname@email.com and I want to delete @email.com from their user. 

I tried doing this from the DB but I ended up changing the usernames how I wanted but the users appear  corrupt.


1 answer

1 accepted

0 votes
Accepted answer

This needs to be properly tested before done on the production but i have done something very similar a few years back and this approach worked superwell.

  1. Create a local admin account in the internal database if you don't already have one.
  2. Shut down JIRA
  3. dump database
  4. do:

    cat your.jira.db.sql | sed 's/@email.com//g' > your.new.jira.db.sql
  5. Drop the database, recreate an empty database, import the new dump.
  6. Restart Jira and attempt to login with what would be your new username

You might have to login with JIRA using a built in admin account if this fails, in that case you might also have to adjust the JIRA user directory to reflect that you no longer use the email, but another object for usernames on AD or whatever you might use.

Once authentication is done, i warmly recommend you to rebuild all indexes. You will also have to do the same for all other systems that ride on Jira's authentication. An example would be if Confluence uses a JIRA user server for authentication, Confluence database would need the same treatment.

Other things to think of:

If you have users with other email addresses you can piggyback these with more sed statements, but beware that a user can only exist once, so if you have a tony@email1.com and a tony@email2.com you will end up with a conflict.

I warmly recommend you to test, test, test, test and test again on a virtual server that is a close clone of your system before you actually go ahead and do this on a production system. Make sure you back up both databases and filesystems so you can reverse fast. Make it an art, than kick it into gear.

Good luck.

Thanks Jonas, I will try to do this!

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Jan 08, 2019 in Jira

How to Jira for designers

I’m a designer on the Jira team. For a long time, I’ve fielded questions from other designers about how they should be using Jira Software with their design team. I’ve also heard feedback from other ...

812 views 3 9
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