JIRA:如何使用“密钥”或“ Issuekey”进行搜索

时间:2018-08-01 12:29:53

标签: jira jira-rest-api jql jira-rest-java-api

我正在对JIRA实例进行以下REST API调用。 正在将总结果设为1,但在问题中未获取任何值:[]

JQL:

http://myjira:8080/rest/api/2/search?startAt=1&maxResults=50&fields=project,status&jql=fields project status jql project=C00195 and key=C00195-2210

但是我收到一个错误响应:

{"startAt":1,"maxResults":50,"total":1,"issues":[]}

JQL以上在浏览器中也不起作用。

如果我们删除键过滤器,则说明它按预期工作。

有效的JQL:

http://myjira:8080/rest/api/2/search?startAt=1&maxResults=50&jql=project=C00095

响应:

{"expand":"schema,names","startAt":1,"maxResults":50,"total":2175,"issues":[{"expand":"operations,versionedRepresentations,editmeta,changelog,renderedFields","id":"12560","self":"http://myjira:8080/rest/api/2/issue/12560","key":"C00095-2215","fields":{"parent":{"id":"12559","key":"C00095-2214","self":"http://myjira:8080/rest/api/2/issue/12559","fields":{"summary":"Task for tagging testing","status":

1 个答案:

答案 0 :(得分:2)

您需要将startAt从1更改为0。此资源是从零开始计数的,因此通过将其设置为1,您实际上会跳过发现的单个问题。