[英]Querying JIRA to Produce Counts of Issues by Different Type
Suppose I have the following JIRA filter. 假设我有以下JIRA过滤器。
project = XXX AND resolution = Unresolved AND assignee in (EMPTY) ORDER BY Type asc, priority desc
I use it to see all unassigned issues in a certain project and pull from for triage. 我用它来查看某个项目中所有未分配的问题并从中进行分类。
Every now-and-then, I need to know how many are in each Type, ie, I actually want a count for each. 每隔一段时间,我需要知道每种类型中有多少,即我实际上想要计算每种类型。
How could I modify this query to do that or write a new one that accomplishes the same thing? 如何修改此查询以执行此操作或编写一个完成相同操作的新查询?
Remember that JQL isn't SQL - it just operates on tickets and returns lists of them for other parts of JIRA to consume, and doesn't really have a mechanism for counting results. 请记住,JQL不是SQL - 它只是对故障单进行操作并返回JIRA的其他部分要使用的列表,并且实际上没有计算结果的机制。
That said, you can use the JIRA REST API's /search
endpoint along with maxResults=0
to construct JQL queries for each Type
you care about, and the endpoint will give you a total
value for that ticket Type
: 这就是说,你可以使用JIRA的REST API的
/search
端点一起maxResults=0
构建JQL查询每个Type
你计较,和端点会给你total
该票值Type
:
https://jira.url/rest/api/latest/search?jql=project%20=%20XXX%20AND%20resolution%20=%20Unresolved%20AND%20assignee%20in%20%28EMPTY%29%20AND%20Type%20=%20Task&maxResults=0
Results in this output for Type=Task
: Type=Task
输出结果如下:
{
"startAt":0,
"maxResults":0,
"total":123,
"issues":[]
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.