How do I do wildcard searches in the rest API?

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

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
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Julia Dillon
Posted Apr 17, 2018 in Jira

Tell us how your team runs on Jira!

Hey Atlassian Community! Today we are launching a bunch of customer stories about the amazing work teams, like Dropbox and Twilio, are doing with Jira. You can check out the stories here. The thi...

807 views 2 19
Join discussion

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you