What to do to change usernames in JIRA?

yns cese November 19, 2012

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

1 vote
Answer accepted
Peter von Hofer November 19, 2012

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

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 19, 2012

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

C_ Faysal
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.
November 19, 2012

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

Nic Brough -Adaptavist-
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
November 19, 2012

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!)

JamieA
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.
November 19, 2012

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.

2 votes
C_ Faysal
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.
November 19, 2012

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

yns cese November 20, 2012

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?

Peter von Hofer November 20, 2012

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

yns cese November 20, 2012

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.

Peter von Hofer November 20, 2012

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

groovyrunner 1.7.14

Manage plugin modules - 11 of 11 modules enabled.

yns cese November 20, 2012

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

yns cese November 20, 2012

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

Peter von Hofer November 20, 2012

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

yns cese November 20, 2012

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

Peter von Hofer November 20, 2012

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

yns cese November 20, 2012

Thank you, I really appreciate your help.

yns cese November 20, 2012

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.

Peter von Hofer November 20, 2012

In v.1.7.14 it looks like this:

I think you shouldn't need to change the script

yns cese November 20, 2012

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?

Peter von Hofer November 20, 2012

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

yns cese November 20, 2012

Yes, thank you again.

0 votes
C_ Faysal
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.
November 19, 2012
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
TAGS
AUG Leaders

Atlassian Community Events