Forums

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

Getting an empty list when using the search_users function on Jira Cloud.

Michelle_Kyne1
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 30, 2025

Getting an empty list when using the search_users function against Jira Cloud

jira_user = jira.search_users(query=email, maxResults=20)

print(len(jira_user))
Output
0
It works fine on our Jira server instance using the format below:
jira_user = jira.search_users(user=display_name, maxResults=20)

print(len(jira_user))
Output
1
The user exists on both Jira instances.

1 answer

0 votes
Marc - Devoteam
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.
April 30, 2025

Hi @Michelle_Kyne1 

Welcome to the community.

So there a scripts developed by users, not Atlassian, the link provided. 

Ask the developers of the scripts to help you out.

On Cloud the only way to get a user is via the Account ID, also see API doc's

https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-users/#api-rest-api-3-user-get 

You can get a user based on email via the API.

The call should be: https://<intance-name>.atlassian.net/rest/api/3/user/search?query={{<email-addresss>.urlEncode}}

Michelle_Kyne1
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 30, 2025

hi @Marc - Devoteam I actually get the same empty list when using the API request directly. Again it works fine on the jira server instance using:
/rest/api/2/user/search?username=email 

Could I be missing some specific extra permission needed on Jira Cloud for retrieving user information?

Marc - Devoteam
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.
May 1, 2025

Hi @Michelle_Kyne1 

As mentioned, on Cloud you can only get a user via the account ID in API, or the API search call , providing the full email address.

/rest/api/3/user/search?query=

Michelle_Kyne1
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!
May 1, 2025

hi @mar ya that's the form I used for Jira Cloud:

https://ibm-qrs-sandbox-001.atlassian.net/rest/api/3/user/search?query=<email>

I was just indicating with the /rest/api/2/user/search?username=email that I tried the equivalent call on Jira server and it works. 

Like Marc - Devoteam likes this

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events