It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

JQL query wrong results Edited

I've created a curl script but it seems the query is showing wrong results.

curl -H "Authorization: Basic ZnJhbmtsaW4ubWFudWJhZ0BhY2MuY28ubno6WW5HQUFNdUJ4WmF0NDBUelVielUyRDAy" -X GET -H "Content-Type: application/json" ""

1 answer

The data part of parameter jql has to encoded ans jql does not take & in query, so if you JQL query is,

project=NAME AND status=done

it should be url encoded,


If you are not happy with encoding your query every time, try using POST request in place of GET request for JQL search, check this page ('Searching for issues examples' section)

Thanks.. that worked..

I'm facing another issue adding the fixVersion but the value has a space. The http link works on a browser but fails on curl.

curl -H "Authorization: Basic ZnJhbmtsaW4ubWFudWJhZ0BhY2MuY28ubno6WW5HQUFNdUJ4WmF0NDBUelVielUyRDAy" -X GET -H "Content-Type: application/json" ""

This worked for me,


 Also I suggest you switch to POST request to search for issues via API, in that you can copy query directly from search field, no need for encoding etc.

I've used your suggestion and encountered this error.. I will test the POST


{"errorMessages":["Error in the JQL Query: Expecting operator before the end of the query. The valid operators are '=', '!=', '<', '>', '<=', '>=', '~', '!~', 'IN', 'NOT IN', 'IS' and 'IS NOT'."],"errors":{}}

@Franklin Manubagrequest type POST is best suited for this.

Also I think you are using Jira Cloud? If so switch to API version 3.


I've tried POST


curl -H "Authorization: Basic ZnJhbmtsaW4ubWFudWJhZ0BhY2MuY28ubno6WW5HQUFNdUJ4WmF0NDBUelVielUyRDAy" -X POST -H "Content-Type: application/json" --data '{"jql":"project = NAME","status=done", "fixVersion=AB 3.1","fields":["id","key"]}' ""


and got an error

{"errorMessages":["Unexpected character (''' (code 39)): expected a valid value (number, String, array, object, 'true', 'false' or 'null')\n at [Source: org.apache.catalina.connector.CoyoteInputStream@159e59b8; line: 1, column: 2]"]}

Try this,

curl --request POST \
--url '' \
--header 'Authorization: Basic ZnJhbmtsaW4ubWFudWJhZ0BhY2MuY28ubno6WW5HQUFNdUJ4WmF0NDBUelVielUyRDAy' \
--header 'Accept: application/json' \
--header 'Content-Type: application/json' \
--data '{
"jql": "status = done AND project = NAME AND fixVersion = \"AB 3.1\""

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Jira

The add-in you’ve been waiting for: Jira Cloud for Excel 🙌

Introducing Jira Cloud for Excel Here at the product integrations team at Atlassian, we are thrilled to announce the new Jira Cloud for Excel add-in! This add-in lets you export Jira data directly ...

842 views 5 22
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you