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
4,364,565
Community Members
 
Community Events
168
Community Groups

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

Edited

 

All,

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?

or

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

 

Thanks,

Kiran. M

0 comments

Comment

Log in or Sign up to comment
TAGS

Atlassian Community Events