I would like to use JIRA API to bulk rename usernames. I am currently using JIRA 6.3.14 and I am also having the Groovy Plugin installed. I am not able to find any API to help me achieve this. Can someone point me to the right direction. As we are maintaining a big user directory the use of Jira UI for manual update of the username is not an option
import com.atlassian.jira.user.DelegatingApplicationUser import com.atlassian.crowd.embedded.impl.ImmutableUser import com.atlassian.jira.user.ApplicationUsers import com.atlassian.jira.user.ApplicationUser import com.atlassian.jira.user.util.UserUtil import com.atlassian.jira.user.util.UserManager; import com.atlassian.crowd.embedded.api.User; import com.atlassian.jira.component.ComponentAccessor; UserManager userManager = ComponentAccessor.getUserManager(); ApplicationUser appUser = userManager.getUserByKey("<old_username>"); ImmutableUser.Builder builder = ImmutableUser.newUser(ApplicationUsers.toDirectoryUser(appUser)); builder.name("<new_username>"); userManager.updateUser(new DelegatingApplicationUser(appUser.getKey(), builder.toUser()));
Badges are a great way to show off community activity, whether you’re a newbie or a Champion.Learn more
As part of the Bitbucket product team I'm always interested in better understanding what kind of impact the use of our tools have on the way you work. In a recent study we conducted of software devel...
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!
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