Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

API Quoted or Exact String Search

Chad Molenda January 19, 2014

In JIRA's interface, I can search for an exact string for fields such as summary, comment, or description using JQL such as:

summary ~ "\"Some exact search string\""

However, I can't seem to get that kind of exact search quoting to work through the rest API.

In my case, I'm calling curl from within ruby:

# Example code 
class JIRA
  def find_by_summary(exact_query)
    `curl "https://#{username}:#{password}@jira.mydomain.com/rest/api/2/search?jql=summary~'#{exact_query}'"`
  end
end

I can't seem to get a URL to work with any type of quote or escaped quote within the "summary~'#{exact_query}'" portion of the code. Does anyone have any suggestions on how to format a curl call that will allow exact phrase matching JQL in the API query?

Thanks,
Chad

2 answers

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Chad Molenda August 24, 2015

Hi Jaikumar, Unfortunately we did not. Since this wasn't part of any critical tool, we opted just to pull whatever issues the non-quoted query retrieved and then filter them in ruby. Terrible hack, I know, but not important enough to dig any further in for us. That being said, if you do find a way, I'd love to hear about it. Best of luck!

0 votes
Jaikumar HM August 24, 2015

Chad Molendra, I'm also facing the same issue, did you figured out any solution for this problem?

TAGS
AUG Leaders

Atlassian Community Events