Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How to easily get userKey for user

Hana Kučerová
Community Champion
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

3 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 Champion
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
4 votes
Agnes Kal
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
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 Nahvi
Contributor
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
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
July 3, 2023

Almost the same:

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

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

Suggest an answer

Log in or Sign up to answer