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

1 vote
Kseniia Trushnikova
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
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.

Suggest an answer

Log in or Sign up to answer