Groovy script runner error 404 when merging a user

Claudio Ombrella Community Champion Jan 17, 2013


One of our JIRA systems in the company is moving to LDAP authentication. I am using the Groovy Script Runner on other systems and never had an issue. So this is what I did.

The first time I installed the latest beta. As it did not work, I disabled, uninstalled and then installed the latest release 2.0.11. I always have the same issue which is this message:

Not Found (404)

assert gvs.size() == 1 | | | | 2 false [[lastName:Becker,, updatedDate:2012-05-15 12:25:55.867, directoryId:10001,, credential:nopass, id:10015, lowerFirstName:mario, userName:mbecker, active:1, lowerLastName:becker, lowerDisplayName:mario becker, lowerUserName:mbecker, firstName:Mario, displayName:Mario Becker, createdDate:2011-11-03 12:11:33.21], [lastName:Becker,, updatedDate:2013-01-18 16:23:17.958, directoryId:1,, credential:{PKCS5S2}w8CKptZccADjlfA1N66Tb2hjy7ALXLOeyHSW9Hi0z2KBZgsFW/09+jB5OguEAxHn, id:10710, lowerFirstName:mario, userName:mbecker, active:1, lowerLastName:becker, lowerDisplayName:mario becker, lowerUserName:mbecker, firstName:Mario, displayName:Mario Becker, createdDate:2013-01-10 15:44:52.813]]

Could not find what you were looking for. Maybe you should raise an issue.

Did anyone come across the same issue? If yes how did you fix it?
Best regards
Claudio Ombrella

2 answers

1 accepted

Accepted Answer
0 votes

Claudio... there are various issues here.

What's it trying to tell you, in a very confusing way, is that there is more than one user with the username you are trying to merge. This means they exist in more than one directory.

Because there is no way of specifying which directory you want to search in, the script is just bombing out. This was mostly laziness on my part, ie I should not use an assertion failure to stop execution... but most of this code was written before it was possible that you could have duplicate user names.

I'm not sure if I will update this code to handle this as it's very invasive, and Atlassian have committed to fixing this (ie allowing rename of users). Assuming you are trying to merge the two mbecker's together, I don't think you are going to be able to.

Claudio Ombrella Community Champion Jan 19, 2013

Thanks Jamie for your prompt answer. We have 1 JIRA Internal Directory plus 2 directories disabled (I will remove them) plus the new JIRA Internal Delegated Authentication. I will test tomorrow removing the 2 disabled and try again, probably you are right the user is defined with same ID in multuple directories. By the way in the new one (JIRA Internal Delegated Authentication) the user ID is different. More news tomorrow!

Have a nice Sunday!


Hi Claudio. Sounds good. If at all possible I would reproduce this on a copy of production, and only once you're happy with the steps should you repeat in production.

Apart from the internal dir, you can see mbecker is also in directory 10001. If you float your mouse over the "edit" operations or whatever on the directories you can see which one corresponds to 10001. If that's one of the disabled ones it should work if you delete that.

Claudio Ombrella Community Champion Jan 20, 2013

Hi Jamie:

I removed the disabled directories, we no longer needed them, but the error stil persists. I tried to disable and enable the plugin to clear any memory settings (though did not stop/start JIRA) and I keep getting the same error. Seems like the user is still defined internally in the user DB. What can we do next?

By the way now the error message changed. See screenshot below. It was not the same format before.

Thanks a lot


It seems to be the same error though... I'm afraid what this means is you can't use script runner to do anything with this user.

*If* you have this in test, and you trying to merge both mbecker's, I think you can try to delete one of them from cwd_user. You will lose whichever group memberships the one you delete has. After that both mbecker's should be the same. The other thing is to try jira 5.2 where there is a merge directory (or something) option.

What I have found in my testing is you can move the group by updating the cwd_group table just change the directory_id to the new directory id, this will move the groups. Just make sure to not already have the same groups created in the new directory. We had an internal directory went to AD and now have to merge users to a new AD from the company that just bought us. Our internal and original AD had the same user names. This has NOT been fully tested but initial indications show it worked.

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Sep 18, 2018 in Jira

What modern development practices are at the heart of how your team delivers software?

Hey Community mates! Claire here from the Software Product Marketing team. We all know software development changes rapidly, and it's often tough to keep up. But from our research, we've found the h...

25,542 views 2 7
Join discussion

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