如何使用 JQL 检索特定状态的问题

2024-03-19

输入 url,或使用curl 运行,例如:

https://<myurl>/rest/api/2/search?jql=project=<myproject>&status=closed&fields=id,key,status,project&maxResults=5

返回我项目中的 5 个项目,但具有所有状态。由于某种原因,我无法查询特定状态。

输出(部分)是:

{
  "expand": "schema,names",
  "startAt": 0,
  "maxResults": 5,
  "total": 727,
  "issues": [
    {
      "expand": "editmeta,renderedFields,transitions,changelog,operations",
      "id": "79577",
      "self": "https://<myurl>/rest/api/2/issue/79577",
      "key": "<myproject>-774",
      "fields": {
        "project": {
          "self": "https://<myurl>/rest/api/2/project/<myproject>",
          "id": "14421",
          "key": "<myproject>",
          "name": "<myproject>",
          "avatarUrls": {
            (...)
          }
        },
        "status": {
          "self": "<myurl>/rest/api/2/status/1",
          "description": "The issue is open and ready for the assignee to start work on it.",
          "iconUrl": "https://<myurl>/images/icons/statuses/open.png",
          "name": "Open",
          "id": "1"
        }
      }
    },(...)
  ]
}

如何查询给定的状态?非常感谢。


对属性使用 URL 编码。

也许使用在线工具,例如this http://meyerweb.com/eric/tools/dencoder/对您的 JQL 进行 URL 编码:

project = PROJECTKEY AND status = Closed

得到这个:

/rest/api/2/search?jql=project%20%3D%20PROJECTKEY%20AND%20status%20%3D%20Closed&fields=id,key,status,project&maxResults=5

生成的 JSON 将是所有已关闭的问题。

本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

如何使用 JQL 检索特定状态的问题 的相关文章

随机推荐