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

Next challenges

Recent achievements

  • Global
  • Personal

Recognition

  • Give kudos
  • Received
  • Given

Leaderboard

  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

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 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
Community showcase
Published in Jira

Announcing the waitlist for Jira Work Management

Hey there Cloud Community members! We’re excited to give you the first glimpse of the new home for business teams on Jira — Jira Work Management. Jira Work Management is the next generation of J...

753 views 12 19
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