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

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,556,072
Community Members
 
Community Events
184
Community Groups

JIRA REST API: User search not working as documented

Deleted user Jun 09, 2021

I'm trying to use the user search to find a user by display name:

Example URL: https://<jira-instance>/rest/api/2/user/search?query=Test

 

Response:

{ "errorMessages": [ "The username query parameter was not provided" ], "errors": {}}

 In order to make this work I also have to supply the `username` attribute which defeats the purpose of the user search.

 

As far as I can tel, this request should work according to the documentation here: https://developer.atlassian.com/cloud/jira/platform/rest/v2/api-group-user-search/#api-rest-api-2-user-search-get

 

Am I doing something wrong here?

 

1 answer

1 accepted

0 votes
Answer accepted
Niranjan
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.
Jun 09, 2021 • edited

Hi @[deleted] ,

Could you try this https://<jira-instance>/rest/api/2/user/search?username=Test 

Deleted user Jun 09, 2021

That seems to work, thanks! So, is the query parameter not actually used for anything since if providing the username attribute you're effectively cancelling that out? And, the username attribute actually searches in the displayName as well?

Niranjan
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.
Jun 09, 2021 • edited

@[deleted] - A query string that is matched against user attributes ( displayName, and emailAddress) to find relevant users. The string can match the prefix of the attribute's value. For example, query=john matches a user with a displayName of John Smith and a user with an emailAddress of johnson@example.com. Required, unless accountId or property is specified.

 

Kindly accept the answer so that the post can be marked as Solved. Thanks

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events