Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
Community Members
Community Events
Community Groups

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

Atlassian Community Events