Jira 关键绩效指标图表小工具
我需要创建一个显示关键绩效指标的图表。 (问题总数/已解决的问题)
我使用此查询返回问题总数和未解决问题的计数:
JqlQueryBuilder.newBuilder();
final JqlClauseBuilder jqlClauseBuilder = JqlQueryBuilder.newBuilder().where().defaultAnd().unresolved();
Query query;
Query unresolvedQuery;
query = jqlClauseBuilder.created().gtEq("-" + Integer.toString(start) + "d").and().
created().ltEq("-" + Integer.toString(start-delta) + "d").buildQuery();
unresolvedQuery = jqlClauseBuilder.created().gtEq("-" + Integer.toString(start) + "d").and().
created().ltEq("-" + Integer.toString(start-delta) + "d").
unresolved().buildQuery();
Long totIssues = searchService.searchCount(authenticationContext.getUser(), query);
Long solvedIssues = totIssues - searchService.searchCount(authenticationContext.getUser(), unresolvedQuery);
问题是我得到一个空值... 怎么了?
I need to create a chart that shows Key Performance Indicator.
(total of issues / issues resolved)
I'm using this query to return count of total issues and unresolved issues:
JqlQueryBuilder.newBuilder();
final JqlClauseBuilder jqlClauseBuilder = JqlQueryBuilder.newBuilder().where().defaultAnd().unresolved();
Query query;
Query unresolvedQuery;
query = jqlClauseBuilder.created().gtEq("-" + Integer.toString(start) + "d").and().
created().ltEq("-" + Integer.toString(start-delta) + "d").buildQuery();
unresolvedQuery = jqlClauseBuilder.created().gtEq("-" + Integer.toString(start) + "d").and().
created().ltEq("-" + Integer.toString(start-delta) + "d").
unresolved().buildQuery();
Long totIssues = searchService.searchCount(authenticationContext.getUser(), query);
Long solvedIssues = totIssues - searchService.searchCount(authenticationContext.getUser(), unresolvedQuery);
The problem is that I get a null value...
What's wrong?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我知道为什么了。
查询是正确的,但问题是 query=... 在 FOR 中,所以我还必须移动 jqlClauseBuilder 的声明,否则在第一个查询之后,所有其他查询都创建错误。
I found out why.
The query is correct but the problem was that query=... is in a FOR so I had to move also the declaration of jqlClauseBuilder, otherwise after the first query, all the others are all wrong created.