Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

/rest/api/3/search/jql接口根据传入的不同的jql拿到issue的列表

Haoran Shang
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
January 4, 2026

你好,我有一个问题想请教一下,我现在使用/rest/api/3/search/jql接口根据传入的不同的jql拿到issue的列表,我是用接口调用工具测试时,结果返回的状态是200但是数据为空。我在jira页面上使用相同的jql操作是有数据的,这是为什么,怎么解决?下面是我的curl

--header 'Accept: application/json' \
--header 'User-Agent: Apifox/1.0.0 (https://apifox.com)' \
--header 'Content-Type: application/json' \
--header 'Authorization: Basic' \
--header 'Host: tngd-jira.atlassian.net' \
--header 'Connection: keep-alive' \
--header 'Cookie: atl-sticky-version={"currentVersion":"-17251","currentVersionExpiry":""}; atlassian.xsrf.token=' \
--data-raw '{
  "jql": "project = EW AND issuetype in (\"Dev-Sub Task\",\"Bug\")",
  "maxResults": 5,
  "fields": ["key", "summary", "status", "assignee"],
  "fieldsByKeys": true
}'

1 answer

0 votes
Alexander Nilsson
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
January 4, 2026

Hello Haoran,

welcome to the Atlassian Community and thanks for your question.

Your issue with /rest/api/3/search/jql returning HTTP 200 but an empty issues array despite working JQL in the UI is typically caused by authentication. Important: This POST endpoint is deprecated. Use the new GET /rest/api/3/search instead.

Let me explain the root cause and solution step by step:

1. Authentication is incomplete

2. New GET endpoint (recommended)

Use GET /rest/api/3/search with URL.encoded JQL query parameter. Simpler and future-proof.

curl --request GET \
  'https://tngd.jira.atlassian.net/rest/api/3/search?jql=project%3DEW%20AND%20issuetype%20in%20(%22Dev.Sub.Task%22%2C%22Bug%22)&maxResults=5&fields=key%2Csummary%2Cstatus%2Cassignee' \
  --user 'your.email@domain.com:your.api.token' \
  --header 'Accept: application/json'

3. Why 200 with no issues

  • Unauthenticated requests get valid 200 OK but "total": 0, "issues": [] (no browse permissions).
  • Browser uses session cookies; API requires explicit auth.

4. Next steps

  • Test the GET example above with correct auth.
  • Confirm token users "Browse Projects" permission for project EW.
  • Share redacted JSON response if issues persist.

Note: API tokens expire after 1 year by default (1 to 365 days configurable).

Looking forward to your feedback.

Greetings,
Alex

Sunny Ape
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Champions.
January 4, 2026

@Alexander Nilsson 

Please don't just copy and paste responses that you have sourced from an AI, as they are often very wrong!

This POST endpoint is deprecated. Use the new GET /rest/api/3/search instead

Sorry, but that is completely wrong Alexander and you are providing misinformation on the topic.

The API endpoint you have referenced and told the OP to use was deprecated almost 9 months ago and, as a result, the cURL example you provided in step 2 of your answer cannot possibly work. If you had tested your own code yourself, you would have discovered that.

The endpoint that the OP is using (POST /rest/api/3/search/jql), which is the new Search for issues using JQL enhanced search endpoint, is 100% operational and absolutely has NOT been deprecated.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events