Skip to content
This repository has been archived by the owner on Jul 23, 2020. It is now read-only.

Search Functionality and the Ampersand #247

Open
mike-rivera opened this issue Apr 10, 2020 · 1 comment
Open

Search Functionality and the Ampersand #247

mike-rivera opened this issue Apr 10, 2020 · 1 comment

Comments

@mike-rivera
Copy link

I have a JQL which has an ampersand in the string. i.e. component = "Research & Architecture".
If I use this in my restful API the library or underlying component uri encodes it, so when it gets to the Jira server the string looks like this 'Research %26 Architecture'. This fails the query on the server side stating that it does not exist for the field component.

I have tried the following to see if I can get it to work:

component = "Research & Architecture" - Error. SyntaxError: Unexpected token & in JSON, which makes sense.

component = "Research \& Architecture" - "Error in the JQL Query: '\&' is an illegal JQL escape sequence. The valid escape sequences are \', \", \t, \n, \r, \\, '\ ' and \uXXXX. (line 1, character 57)"

component = "Research \u0026 Architecture" - "The value 'Research %26 Architecture' does not exist for the field 'component'."

component = "Research \u0026 Architecture" - error. The value 'Research %26 Architecture' does not exist for the field 'component'

component = "Research \\u0026 Architecture" - fails on the server with, Error in the JQL Query: '\&' is an illegal JQL escape sequence. The valid escape sequences are \', \", \t, \n, \r, \\, '\ ' and \uXXXX. (line 1, character 57)

I am unable to change the component value, since I do not own it. Is there anything else I can do so it is not encoded, to make this query work?

@mike-rivera
Copy link
Author

After some research and checking stack overflow, this appears to be a limitation with the POST operation a search. Since the JIRA api supports GET on a search. This appears to be a case where a GET operation on a search, would serve as a good alternative.

https://stackoverflow.com/questions/61190145/jira-rest-api-and-ampersand/61210126#61210126

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant