Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Deleted user
0 / 0 points
Next:
badges earned

Your Points Tracker
Challenges
Leaderboard
  • Global
  • Feed

Badge for your thoughts?

You're enrolled in our new beta rewards program. Join our group to get the inside scoop and share your feedback.

Join group
Recognition
Give the gift of kudos
You have 0 kudos available to give
Who do you want to recognize?
Why do you want to recognize them?
Kudos
Great job appreciating your peers!
Check back soon to give more kudos.

Past Kudos Given
No kudos given
You haven't given any kudos yet. Share the love above and you'll see it here.

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

JIRA REST API: User search not working as documented

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

Hi @Emil Berglind ,

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

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?

@Emil Berglind - 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
Community showcase
Published in Jira Service Management

JSM June Challenge #2: Share how your business teams became ITSM rockstars

For JSM June Challenge #2, share how your non-technical teams like HR, legal, marketing, finance, and beyond started using Jira Service Management! Tell us: Did they ask to start using it or...

170 views 6 7
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you