你好,我有一个问题想请教一下,我现在使用/rest/api/3/search/jql接口根据传入的不同的jql拿到issue的列表,我是用接口调用工具测试时,结果返回的状态是200但是数据为空。我在jira页面上使用相同的jql操作是有数据的,这是为什么,怎么解决?下面是我的curl
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:
Authorization header shows only Basic without Base64 credentials, making the request effectively unauthenticated.--user "your.email@domain.com:your.api.token".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'
200 OK but "total": 0, "issues": [] (no browse permissions).Note: API tokens expire after 1 year by default (1 to 365 days configurable).
Looking forward to your feedback.
Greetings,
Alex
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.