How do I do wildcard searches in the rest API?

red888 August 6, 2016

These 2 return an errors:

 

https://MyDom.atlassian.net/rest/api/latest/search?jql=project=PROJ+AND+reporter~joe*+AND+status!=Closed
https://MyDom.atlassian.net/rest/api/latest/search?jql=project=PROJ+AND+reporter~joe+AND+status!=Closed


This works fine:

https://MyDom.atlassian.net/rest/api/latest/search?jql=project=PROJ+AND+reporter=joe+AND+status!=Closed

1 answer

1 accepted

1 vote
Answer accepted
Peter Geshev
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.
August 6, 2016

Hi,

Firstly, not all fields support text searches (reporter does not apparantly) (for more info which fields support it see the documentation) and when performing search characters with wildcards the documentation states 

Wildcard characters need to be enclosed in quote-marks, as they are reserved characters in advanced search. Use quotations, e.g. summary ~ "cha?k and che*"

Keep in mind that when you send the jql as get parameter you will have to urlencode it. Here is an example search with wildcards that works 

 

https://jira.atlassian.com/rest/api/latest/search?jql=project%3D%22Atlassian%20Translations%22%20AND%20summary~%27cas%3F%27

Suggest an answer

Log in or Sign up to answer