maxResults的JIRA REST API JQL查询问题

时间:2017-06-16 00:39:41

标签: jira jira-rest-api

JIRA的REST API搜索并不尊重maxResults参数。

curl -o lambrusco.txt -k -D- -u admin:admin -X GET -H "Content-Type: application/json" https://jira.domain.com/rest/api/2/search?jql=assignee=blackpearl&startAt=0&maxResults=4

无论maxResults是什么,它始终会返回50个结果。

输出: {"expand":"schema,names","startAt":0,"maxResults":50,"total":61,"issues":[{"expand":"operations,versionedRepresentations,editmeta,changelog,transitions,renderedFields","id":"15588","self": ...}

我在这里缺少什么?

3 个答案:

答案 0 :(得分:0)

您的要求看起来不错。以下是官方Atlassian JIRA的示例,该工作正常:

curl -X GET -H "Content-Type: application/json" "https://jira.atlassian.com/rest/api/2/search?jql=assignee=tlay&startAt=1&maxResults=1" | jq -r '.maxResults'

答案 1 :(得分:0)

它看起来与REST API Bug有关!

答案 2 :(得分:0)

使用@grundic所示的curl时,您需要引用该请求,否则外壳将解释与号。请注意,API区分大小写。