Hyphen in /user/search query works incorrectly (like wildcard)

Kamil Koszarny _Appfire_
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
December 12, 2024

Calling Jira Cloud API like this:

/rest/api/3/user/search?query=TC-1

gives in response all users starting with 'TC': (TC1, TC-1, TC2, TC-11, TCanything, ...), while expected result for this query would be to only return users starting with 'TC-1' (TC-1, TC-11, TC-1anything ...). It seems like hyphen '-' works as some wildcard, while it is not stated as wildcard in API documentation (link below).

 

I see 2 solutions:

1. Hyphen is and will stay as special character and I should escape it or use another query. How I can do that to achieve what I need? Then also API docs update would be helpful. 
2. Hyphen should not be treated as special character and you can fix that behaviour on your site.

 

Please inform which of those two applies and help. Thank you.

 

https://developer.atlassian.com/cloud/jira/platform/rest/v3/api-group-user-search/#api-rest-api-3-user-search-get

0 answers

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events