The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

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

query parameter in user search request (Jira on-premise)

Сергей
February 28, 2024

Good day!

I have a question regarding the API for Jira on-premise 7.2.2.

The problem is I have a request that should return me all users that have 'iv' in their name, displayName, email, etc:
rest/api/2/user/assignable/search?project=EF&maxResults=1000&query=iv

But it doesn't work. I'm getting the error: 'The username query parameter was not provided'.

If I change my URL to

rest/api/2/user/assignable/search?project=EF&maxResults=1000&username=iv

It works correctly.

So my questions are:

1. If I'm not mistaken, the query parameter is only available in Jira Cloud?
2. Is there anything I can do to enable the query parameter in my on-premise API?

I appreciate your help

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

1 vote
Kseniia Trushnikova
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 Champions.
February 28, 2024

Hey @Сергей,

  1. You're right. The query parameter for /rest/api/3/user/assignable/search is only available in Jira Cloud. It was added just before the parameter username was announced as deprecated.
  2. You can use the method /rest/api/2/user/picker instead. This method supports 'query':
rest/api/2/user/picker?query=iv

Check out the documentation here.

But it looks like this method only returns users whose names start with 'iv' and not all users who have 'iv' in the middle or at the end of their names.