sumoheavy / jira-ruby

A Ruby gem for the JIRA REST API
MIT License
657 stars 411 forks source link

JIRA::HTTPError: Bad Request when using `"\t"` in exact matching on summary #177

Open a-leung opened 8 years ago

a-leung commented 8 years ago

When doing a JQL query using the exact summary matcher summary ~, tab characters "\t", causes a JIRA::HTTPError: Bad Request.

issue_string = 'summary ~ "\"' + "\t" + '\""'
client.Issue.jql(issue_string)
# => JIRA::HTTPError: Bad Request

where as the REST API will return the proper response:

jira_search_url = "https://<jira site>.atlassian.net/rest/api/2/search?jql=" + issue_string
HTTParty.get(jira_search_url, basic_auth: auth, headers: headers) 
# => {"startAt"=>0, "maxResults"=>50, "total"=>0, "issues"=>[]}

whereas with "\n" returns the correct response from the gem:

issue_string = 'summary ~ "\"' + "\n" + '\""'
client.Issue.jql(issue_string)
# => []

any ideas on this?

Thanks for the great gem!

SimonMiaou commented 7 years ago

Could it be from Jira? What is the content of the exception?