简体   繁体   English

Jira:某个时间点所有门票的状态

[英]Jira: Status of all tickets at a certain point in time

I want to pull out month-by-month stats from a jira project, which shows the number of tickets that were in each state at the start of each month (similar to the Cummulative Flow Diagram, but extractable). 我想从jira项目中提取逐月统计数据,该项目显示每个月初每个州的门票数量(类似于累计流程图,但可提取)。

Is there a way in JQL or SQL to get the status of all tickets in a project at a specific point in time? 在JQL或SQL中是否有办法在特定时间点获取项目中所有故障单的状态?

If you want to do this via SQL for one specific date, Atlassian provides instructions for related useful queries on JIRA 4.x . 如果您希望通过SQL在一个特定日期执行此操作 ,Atlassian会在JIRA 4.x上提供相关有用查询的说明 A particularly-relevant one would seem to be the "Find Statuses of all issues in a project on a given date" query, but it will be a bit of an uphill battle to do this over a varying date range. 一个特别相关的问题似乎是“在给定日期的项目中查找所有问题的状态”查询,但在不同的日期范围内执行此操作将是一场艰苦的战斗。

These queries are still mostly relevant for more modern versions of JIRA, with the main concern being that the JI.pkey column will be blank in JIRA 6+. 这些查询仍然主要与更现代版本的JIRA相关,主要关注的是JI.pkey列在JIRA 6+中将为空白。 To get this data back, you first need to join with the project table with ON project.id=JI.project , and then synthesize the issue key yourself as P.pkey || '-' || JI.issuenum 要获取此数据,首先需要使用ON project.id=JI.project连接项目表,然后自己将问题键合成为P.pkey || '-' || JI.issuenum P.pkey || '-' || JI.issuenum P.pkey || '-' || JI.issuenum . P.pkey || '-' || JI.issuenum You will also probably need to apply typecasts to some of the joins (at least on some databases) since a few joins are trying to relate integer-typed columns with text columns. 您可能还需要将类型转换应用于某些连接(至少在某些数据库上),因为一些连接尝试将整数类型的列与文本列相关联。

For reference, their JIRA 4.x query was the following: 作为参考,他们的JIRA 4.x查询如下:

SELECT JI.pkey, STEP.STEP_ID
FROM (SELECT STEP_ID, ENTRY_ID
      FROM OS_CURRENTSTEP
      WHERE OS_CURRENTSTEP.START_DATE < '<your date>'
UNION SELECT STEP_ID, ENTRY_ID
      FROM OS_HISTORYSTEP
      WHERE OS_HISTORYSTEP.START_DATE < '<your date>'
      AND OS_HISTORYSTEP.FINISH_DATE > '<your date>' ) As STEP,
(SELECT changeitem.OLDVALUE AS VAL, changegroup.ISSUEID AS ISSID
      FROM changegroup, changeitem
      WHERE changeitem.FIELD = 'Workflow'
      AND changeitem.GROUPID = changegroup.ID
UNION SELECT jiraissue.WORKFLOW_ID AS VAL, jiraissue.id as ISSID
      FROM jiraissue) As VALID,
jiraissue as JI
WHERE STEP.ENTRY_ID = VALID.VAL
AND VALID.ISSID = JI.id
AND JI.project = <proj_id>;

If you are open to using a commercial add-on, Arsenale Dataplane can do exactly what you want in a few clicks using the Issue Values Snapshots by Date report. 如果您愿意使用商业插件, Arsenale Dataplane可以使用“ 按日期发布值快照”报告, 通过几次单击完成您想要的操作。 Disclaimer: I work for the company that makes this product. 免责声明:我为制作此产品的公司工作。

With JQL you can only look for Issues not for States. 使用JQL,您只能查找不适用于国家/地区的问题。 About the specific point of time, you can only get information about the current status, unless you develop a complex script that takes in account the current situation and the changes made after the date you want to check (ChangeHistoryManager). 关于特定时间点,您只能获取有关当前状态的信息,除非您开发一个复杂的脚本,该脚本会考虑当前情况以及在您要检查的日期之后所做的更改(ChangeHistoryManager)。

On the other hand, you can configure a Board with a pie chart (in example), where you set the Status field to be shown. 另一方面,您可以使用饼图(在示例中)配置电路板,您可以在其中设置要显示的状态字段。 Additionaly, you can create a Notification so that each first of month you get an email with this information. 另外,您可以创建通知,以便每月的第一天收到包含此信息的电子邮件。

Probably more interesting the scripting solution, but absolutely longer in time, and more complex. 脚本解决方案可能更有趣,但绝对时间更长,更复杂。

Regards 问候

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM