How to easily get userKey for user

Hana Kučerová
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 20, 2020

Hello Community,

please, is there some easy way for Jira administrator how to obtain userKey (~ JIRAUSER12345) for some specific user?

I'm aware, that I can get this information:

  • using REST API
  • looking into the database
  • using some groovy script
  • ...

But I wasn't able to find any straightforward way like get it from User management, click somewhere, use some URL. Am I missing something?

Thank you very much.

3 answers

1 accepted

2 votes
Answer accepted
Soumyadeep Mandal
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 20, 2020
Hana Kučerová
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
December 20, 2020

Hi @Soumyadeep Mandal ,

so, according to the issue JRASERVER-68189, there is no Jira's UI way.

Probably the easist way is to use REST API and URL:

  • $JIRA_URL/rest/api/2/user?username=<User_Name>

Thank you for the confirmation, I thought I'm missing something.

Like Soumyadeep Mandal likes this
3 votes
Agnes Kal April 27, 2022

Go to Script Console in ScriptRunner and type in Script:

import com.atlassian.jira.component.ComponentAccessor; 
ComponentAccessor.getUserManager().getUserByName("username");

Remember to change username

Click Run

The result is below

username(JIRAUSER01010) 

Inayat N March 1, 2023

Hi @Agnes Kal , this works great.  How would I do the opposite?   I have JIRAUSER12345, and I want to show the display name?  Thanks.

Rushan Makhmutov July 3, 2023

Almost the same:

import com.atlassian.jira.component.ComponentAccessor; 
ComponentAccessor.getUserManager().getUserByKey("JIRAUSER12345");
2 votes
Jeremy Cejka December 14, 2021

<JIRAURL>/jira/rest/api/2/user?key=JIRAUSERxxxx

Suggest an answer

Log in or Sign up to answer