I have looked at the script runner "Renames A user ID". How do I go about doing a bulk change of user ID's? I have over 400 user IDs that I need to change.
Thanks
Here's sample. You need to just execute the script in a loop:
def ren = new com.onresolve.jira.groovy.canned.admin.RenameUser(); def input = [ ["admin","newname"], ["asd", "usernew"] ]; def result = "" for (e in input) { def args = [ (com.onresolve.jira.groovy.canned.admin.RenameUser.FIELD_FROM_USER_ID): e[0], (com.onresolve.jira.groovy.canned.admin.RenameUser.FIELD_TO_USER_ID): e[1], (com.onresolve.jira.groovy.canned.admin.RenameUser.FIELD_MERGE): false ]; result+=ren.getDescription(args, true) //Uncomment to actualy execute, the line above is for preview //result+=ren.doScript(args) } result
Thanks for the response Boris. I have tried your script and also the script from this Scott Dudley from this question below
https://answers.atlassian.com/questions/75640/how-can-i-use-the-groovy-runner-jira-user-id-rename-form-the-command-line
The problem I am having is that both scripts are not updating the app_user table in the database. Which is causing the erorr User 'James.Jones' exists but has no unique key mapping.
In Jira 6x you can update the user ID by editing the user in JIRA. This seems to be updating the column lower_user_name in the app_user table. When I run the scripts this is not updated and the way around it is to run these SQL statement and update the app_user table.
https://confluence.atlassian.com/display/JIRAKB/JIRA+Login+Fails+With+the+Message+-+User+exists+but+has+no+unique+key+mapping
INSERT
INTO
app_user
SELECT
(<id
from
previous query + 1>,
'username_that_caused_error'
,
'username_that_caused_error'
FROM
app_user;
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.