Cannot make /rest/api/3/search/jql work out

Hi Experts:

I used curl GET command to query all related Jira ticket number/status in Jira Cloud for years, but it’s not worked any more since September.

curl -D- -u <my_email:my_API_token> -X GET -H ‘Content-Type: application/json’ https://<my_company>.atlassian.net/rest/api/3/search?jql=summary~‘794’&fields=summary

{“errorMessages”:[“The requested API has been removed. Please migrate to the /rest/api/3/search/jql API. A full migration guideline is available at https://developer.atlassian.com/changelog/#CHANGE-2046"],"errors”:{}}‘fields’ is not recognized as an internal or external command, operable program or batch file.

I tried using the /rest/api/3/search/jql API, but I was unable to get any results.

curl --request GET --url https://<my_company>.atlassian.net/rest/api/3/search/jql?jql=summary=794 --user ‘<my_email:my_API_token>’ --header ‘Accept: application/json’

{“issues”:,“isLast”:true}
curl: (6) Could not resolve host: application (remove --header ‘Accept: application/json’ will not get this line)

I tried different “jql=…” formats, but none of them worked:

jql=summary=794
jql=summary~‘794’
jql=summary~‘*794*’
jql=summary%20IN%27794%27

jql=project=SUPPORT

jql=project%20%3D%20SUPPORT

And I cannot use some parameters:

jql=project%20%3D%20SUPPORT&nextPageToken=%3Cnull%3E&maxResults=5000&fields=summary

‘nextPageToken’ is not recognized as an internal or external command, operable program or batch file.
‘maxResults’ is not recognized as an internal or external command, operable program or batch file.
‘fields’ is not recognized as an internal or external command, operable program or batch file.

Pleas help what I missed here.

Thanks.

Given the error, my guess is that the new curl command has either incorrect quoting or another syntax error.

1 Like

Your command looks basically okay, except that I see a bunch of curly quotes instead of straight quotes in your example. (Around the user and header values.) Might that be the problem?

Meaning, try this:

curl --request GET --url https://<my_company>.atlassian.net/rest/api/3/search/jql?jql=summary=794 --user '<my_email:my_API_token>' --header 'Accept: application/json'

instead of this

curl --request GET --url https://<my_company>.atlassian.net/rest/api/3/search/jql?jql=summary=794 --user ‘<my_email:my_API_token>’ --header ‘Accept: application/json’

Hello @LydiaLi

In addition to what others have said, test your requests with an API test tool like Postman FIRST, to at least confirm if you are just making a basic coding mistake, or just using cURL incorrectly.

Also, read the endpoint’s documentation more closely, as:

&maxResults=5000&fields=summary

The maxResults parameter will only return 5,000 results when requesting the id or key fields only. When requesting any other fields, such as summary, the absolute maximum number of items returned per page is 100.

thanks Aaron.

Tried with single quota mark, still not results.

curl --request GET --url https://<my_company>/rest/api/3/search/jql?jql=summary=‘794’ --user ‘<my_email:my_API_token>’

{“issues”:,“isLast”:true}

curl --request GET --url https://<my_company>/rest/api/3/search/jql?jql=‘summary=794’ --user ‘<my_email:my_API_token>’

{“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”:{}}

curl --request GET --url ‘https://<my_company>/rest/api/3/search/jql?jql=summary=794’ --user ‘<my_email:my_API_token>’

curl: (3) URL rejected: Port number was not a decimal number between 0 and 65535

1 Like

Hi @LydiaLi – You must be getting close, because the first command in your list was technically successful (from an API perspective). The reason the results were empty is that Jira couldn’t find any items where the ‘Summary’ field exactly equaled ‘794’. Right?

You probably meant to do: /rest/api/3/search/jql?jql=summary~'794'

That’s what you had in your old query against the deprecated API.

Thanks sunnyape. I did test in postman, same no results.

same no results.

Yep, because the JQL statement fields=summary makes no sense.

JQL finds Work Items that have fields that match certain values, such as summary=”Test 794” or summary~”794” etc, not Work Items that have matching fields:

I recommend that you start your learning journey with an AI tool like ChatGPT to ask basic questions about how to use Jira’s REST APIs, how JQL works and how to build a correctly formatted request using cURL

Have fun

thanks sunnyape.

I have used ChatGPT. I also consulted the Jira Cloud support team, but none of their suggestions worked.

In Jira Cloud, search the summary field to find relevant ticket containing a specific number (e.g., User Termination Request #794 ). I am trying to find out in the new /rest/api/3/search/jql API, how to query in SUMMARY field?

My answer said exactly how to do it:

such as summary~”794” etc

and the screen grab I provided shows exactly how to do it:

Untitled

Read the JQL documentation…

  1. JQL Cheat Sheet
  2. Using JQL
  3. JQL Reference documents

Ask ChatGPT…

“Using Curl on Windows make a request to the Jira Cloud REST API, please show me an example of how to make a JQL query to find Work Items where the Summary field contains a certain value”

or maybe…

“Provide an example of how to use CURL on Windows to make a request to the Jira Cloud ‘Search for issues using JQL enhanced search’ REST API endpoint that to find the Work Items that have a Summary field that contains the number 794”

Goodbye!

thanks Aaron, thanks sunnyapo. this format worked:

https://<my_company>.atlassian.net/rest/api/3/search/jql?jql=summary~‘794’&fields=summary

this is what I am looking for. Thanks a lot Aaron.

jql=summary~‘794’&fields=summary is worked in postman, but not with curl in the windows.

my crul version is

curl 8.13.0 (Windows) libcurl/8.13.0 Schannel zlib/1.3.1 WinIDN
Release-Date: 2025-04-02

any suggestions?

Thanks.

Hi @LydiaLi – Yes, if it is working in Postman, then I suggest exporting the working command from Postman into cURL. This tutorial describes how to do it:

The basic steps are:

  1. Open the working command in Postman.
  2. Select the “Code Snippet” tool.
  3. Select “cURL”.
  4. Select “Copy”.
  5. Then paste the command into cURL.

Thanks a lot Aaron. will follow the steps to try it out.