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

rest/api/2/user/search not returning user

Viktor Lund May 27, 2013

"curl -u username:password https://subdomain.atlassian.net/rest/api/2/user?username" returns my user. But

"curl -u username:password https://subdomain.atlassian.net/rest/api/2/user/search?username=u" or

"curl -u username:password https://subdomain.atlassian.net/rest/api/2/user/search?username=username" or

"curl -u username:password https://subdomain.atlassian.net/rest/api/2/user/search?username=useremail"

Returns an empty array. Would be nice if someone could help me with this one (user is not inactive)

By the way what I really need is the ability to search users by email.

4 answers

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

1 vote
Nadir MEZIANI
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 27, 2013

Hi,

Have you the privilege to browse users?

In my instance when I execute this


http://My server/rest/api/2/user/search?username=u@b.c&includeActive=true&includeInactive=true

I have this result

[{"self":"http://My server/jira/rest/api/2/user?username=util2","name":"util2","emailAddress":"u@b.c","avatarUrls":{"16x16":"http://My server/jira/secure/useravatar?size=small&avatarId=10122","48x48":"http://My server/jira/secure/useravatar?avatarId=10122"},"displayName":"Utilisateur 2","active":true,"timeZone":"Africa/Luanda"},{"self":"http://My server/jira/rest/api/2/user?username=util3","name":"util3","emailAddress":"u@b.c","avatarUrls":{"16x16":"http://My server/jira/secure/useravatar?size=small&avatarId=10122","48x48":"http://My server/jira/secure/useravatar?avatarId=10122"},"displayName":"Utilisateur 3","active":true,"timeZone":"Africa/Luanda"}]
0 votes
Brian Choate March 4, 2015

Also, I cannot find the bug ticket referenced above.

 

0 votes
Brian Choate March 4, 2015

That does not seem to work. I am trying to use the Rest API with our on-demand instance. If I use the parameter username=bchoate it works and will return my user record. If I use username=bchoate@wikia-inc.com it returns an empty array. In the case where I am using email the email string is getting properly url encoded before sending. 

salzschneider August 31, 2015

Your API user needs the Browse Users global privilege.

0 votes
Bob Swift OSS (Bob Swift Atlassian Apps)
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 25, 2014

It seems to be a recent bug on the latest OnDemand version. Here is what it should return: https://docs.atlassian.com/jira/REST/latest/#d2e3553

I created: JRA-38489

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

TAGS
AUG Leaders

Atlassian Community Events