Are you in the loop? Keep up with the latest by making sure you're subscribed to Community Announcements. Just click Watch and select Articles.

×
Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

How can you update a User Picker custom field for a renamed user?

Our Jira instance has groovy code that assigns values to various UserPicker custom fields.

During workflow transitions, our code essentially does:

ApplicationUser appUser = userManager.getUserByName("username")
...
issue.setCustomFieldValue(ourUserPickerCustomField, appUser)

This works, but we recently ran into a case where for a particular User it didn't work.

After looking into it, it turns out that what makes this User unique is that he had his username changed through the Jira GUI at some point.  For example, if he had been created with "username" and subsequently updated to "username2", the app_user table now looks like this:

jira=> select * from app_user where user_key not like lower_user_name;
id | user_key | lower_user_name
-------+-----------------------+-------------------------------
13400 | username | username2

I've verified that the appUser object is correctly retrieved from the userManager, but it seems as though setCustomFieldValue function can't find the right user to set the CF to.

I've also tried updating the CF using the updateValue method, but this seems to have the same problem.

Anyone run into this, and have a workaround?

We're on Jira 7.1.2 FWIW.  

 

1 answer

Suggest an answer

Log in or Sign up to answer

Hi @Rick Trudeau, I ran into the same problem. Is there any solution for this yet?

Thanks

Nah, never heard back about this.  We had such a limited number of users who this affected that we just managed them individually.

Hi @Rick Trudeau Thanks for the reply. We actually have this problem with more than 800 users. 

TAGS
AUG Leaders

Atlassian Community Events