What to do to change usernames in JIRA?

Using JIRA v4.4 and want to change usernames in JIRA. But it seems that I have to install add-on to update usernames. After a search in google I found that the most people recommend to install Script Runner add-on. Up to now it is okay, but what to do next? How can I change user names with Script Runner add on now? Or is there a better way to change user names?

3 answers

1 accepted

You also have to look after custom fields containing user ids. They probably won't be changed by the script.

Out of curiosity, has anyone tried this on v5 and checked "mentions"? Does it correct them too?

good point. to be honest i've never ever used this script to change names..i always did the steps directly in the DB.

but the last time was before the v5 release and therefor without mentions. but i think this works with some kind of keys and won't have any bad side effect after renaming userIDs. maybe a re-index should be done afterwards

I've used it a couple of times, but on older Jira installs. I've also done it in the database and I don't like it much - there's far too many tables to hit (jira issues, custom user pickers, comment authors, etc. I think I found 11 tables to hit last time, and I'd guess mentions are probably buried in a block of text as well!)

They are actually changed by the script. You should try it on a test instance first.

Mentions, no... are they cross-referenced in a db table? If so then no, they won't be got.

take a look at the built in scripts.

you will find

Renames a user ID
Changes a user's ID without reindexing or restarting

regards

First of all thank you for your answer and Sorry for my unfamiliarity but I can't find built in scripts. Where are those built in scripts?

Administration -> Plugins -> Script Runner -> View Built In Scripts

Thank you Peter. When I press built-in scripts; it returns;

HTTP Status 404 - Could not execute action [CannedScriptRunner]:Action 'com.onresolve.jira.groovy.CannedScriptRunner' could not be instantiated.

So could you please send me username script code so I can paste it and run in my jira. Or do you know how can I solve this issue? By the no updates came up.

Could you check if all modules are active (Admin -> Plugins -> Plugins)

groovyrunner 1.7.14

Manage plugin modules - 11 of 11 modules enabled.

yes all modules are active. It says 21 of 21 modules are enabled.

If I find change name script code and paste and run it, does that solution work?

Jamie Elchin, the developer says yes (5 comments below this). But you should really try it on a test instance!

so if you have the script, could you please send me?

You can find it in the groovyrunner-xxxx.jar

Just rename it to ".zip" open it and go to this directory/file

/com/onresolve/jira/groovy/canned/admin/RenameUser443.groovy

Thank you, I really appreciate your help.

By the way if I have a name "abab" and want to change it to "cdcd", what to change in this script so that I can run it? Again sorry for my inconvenience.

In v.1.7.14 it looks like this:

I think you shouldn't need to change the script

I am using v.1.7.14 too. It looks like what, you left it blank? But if I don't change anything, how it knows to change abab to cdcd?

there was some problem with the image attachment. hope you see it now.

when you start the script, you see two input fields for old and new user_id

Yes, thank you again.

if i find time tomorrow i will test it for you in one of my sandboxes. i'll provide some update info then

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Bridget Sauer
Published Apr 19, 2018 in Marketplace Apps

Calling all developers––You're invited to Atlas Camp 2018

 Atlas Camp   is our developer event which will take place in Barcelona, Spain  from the 6th -7th of   September . This is a great opportunity to meet other developers and get n...

366 views 0 6
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