如何使用JQL检索特定状态的问题 [英] How do I retrieve issues of specific status with JQL

查看:570
本文介绍了如何使用JQL检索特定状态的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

输入网址或运行curl,例如:

Entering a url, or running with curl, like:

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

在我的项目中向我返回5个项目,但它们具有所有状态.由于某些原因,我无法查询特定状态.

returns me 5 items in my project but with all statuses. For some reason I can't query for a specific status.

输出(部分输出)是:

{
  "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"
        }
      }
    },(...)
  ]
}

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

How to query for a given status? Many thanks.

推荐答案

在属性上使用URL编码.

也许使用之类的在线工具来通过以下方式对您的JQL进行URL编码:

Perhaps use an online tool like this to URL encode your JQL from this:

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将是所有已关闭的问题.

The resulting JSON will be all closed issues.

这篇关于如何使用JQL检索特定状态的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆