Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

getUserByKey(<username>) is not working when change the user name




I have created custom postfuncion from open to in progress.

I have used the one active user(newtest) to pre populate in one of the fields in post function. It is working fine when I transition.

However, I have changed the user name to newtest_old, made it inactive, and created a new user with same name. I have done it through the admin ui.

Now, I ran the transition and check the user name it returns an inactive user in Jira710 and Jira7130. In jira840 it is blank, as per the below code, getting user by getUserByName() and works fine.


Note:  This issue is on Jira 710 version and 713 versions not on jira84.0

I am using jira7.0.0 api version code snippet which I used as below:


ApplicationUser user = ComponentAccessor.getUserManager().getUserByKey(name);

        if (user == null) { // try lookup by name instead of key

            user = ComponentAccessor.getUserManager().getUserByName(name);



Could you please help me understand is there any issue with getUserByKey() on Jira 710 and 7130 versions?


When can I use getUserByKey() and getUserByName()?



Kiran. M



Log in or Sign up to comment
Community showcase
Published in Jira

Admins, notify your Jira instance of system-wide changes with the new admin announcement banner

Hi All! We’re excited to share the launch of an announcement banner that lets Jira site administrators communicate directly to their users across their  Jira Cloud instance.  ...

495 views 16 17
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you