gpt4 book ai didi

rest - JIRA REST API -- 如何查询问题状态名称

转载 作者:行者123 更新时间:2023-12-04 14:00:05 25 4
gpt4 key购买 nike

我正在使用 JIRA REST API,我想查询处于“已解决”状态的所有问题。状态字段如下所示:

"status": {
"self": "https:\/\/jira.atlas.xx.com\/rest\/api\/2\/status\/5",
"description": "A resolution has been taken, and it is awaiting verification by reporter. From here issues are either reopened, or are closed.",
"iconUrl": "https:\/\/jira.atlas.xx.com\/images\/icons\/statuses\/resolved.png",
"name": "Resolved",
"id": "5",
"statusCategory": {
"self": "https:\/\/jira.atlas.xx.com\/rest\/api\/2\/statuscategory\/3",
"id": 3,
"key": "done",
"colorName": "green",
"name": "Complete"
}
}

目前知道这样做的唯一方法是查询 status=5。使查询更直观并使用字符串“已解决”状态查找所有问题会很好。这是我正在使用的查询:
https://jira.atlas.xx.com/rest/api/2/search?jql=project=MYPROJECT and status=5 and fixVersion=15824&fields=id,key,description,status

是否可以查询状态名称?

最佳答案

是的,您也可以查询状态名称。

我认为你应该使用官方的 Jira 文档,尤其是 this使用 JQL 查询等高级搜索选项时。

本文档描述了您可能的 JQL 查询的每个部分。如果你看 Fields reference部分,您将在那里找到可以搜索的字段以及可能的属性。例如,在 Status 的情况下 field :

You can search by Status name or Status ID (i.e. the number that JIRA automatically allocates to a Status).

据此,您的查询可以轻松修改
https://jira.atlas.xx.com/rest/api/2/search?jql=project=MYPROJECT and status=Resolved and fixVersion=15824&fields=id,key,description,status

关于rest - JIRA REST API -- 如何查询问题状态名称,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25614131/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com