Issue passing JQL query in REST API Resource - Jira

Hi all,

I'm having a strange issue trying to pass a JQL query to our Jira REST endpoint. The query is pretty straightforward. This is the URL of the Resource:

https://ourcompany.atlassian.net/rest/api/3/search/

I need to pass it a JQL filter ID, which is ?jql=filter=17653

When I run this, it returns a response:

{
  "errorMessages": [
    "A value with ID '17653' does not exist for the field 'filter'."
  ],
  "warningMessages": []
}

When I look at the API Request I can see that it is changing the second = sign to %3D so the request.url sent is actually:

"https://ourcompany.atlassian.net/rest/api/3/search/?jql=filter%3D17653"

I tried a number of variations of putting the query string in URL params etc but always end up with the same result.

I have a number of other REST resources for Tempo, Jira, FreshDesk etc but can't get this one to work.

Anyone seen something like this or have ideas I can try?

Thanks!
Nick

Hey @nickaus! Looks like Atlassian recommends using a POST request and passing the JQL as a JSON payload which removes the need to escape any characters which may be getting encoded. Currently, all url params get encoded in Retool.

Let me know if that works for you!

Hey @joeBumbaca

Thanks for your suggestion :pray: I had moved on with a workaround but tried this just now.

I'm passing this as Body/Raw

{
  "jql": "project = INTSD and filter = 17653"
}

This gives the errors:

{
  "errorMessages": [
    "The value 'INTSD' does not exist for the field 'project'.",
    "A value with ID '17653' does not exist for the field 'filter'."
  ],
  "warningMessages": []
}

I can see in the API Request that the body does not look right (with the escape \ characters):

"body": "{\"jql\":\"project = INTSD and filter = 17653\"}",

I've tried single/double quotes, using Body:Raw and Body:JSON but basically the same results for all the combinations I tried.

Again this works fine in Postman. It looks like I need to escape something perhaps but not sure what/how.

Regards,
Nick