Jira Key Performance Indicator Chart Gadget
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.creat开发者_运维问答ed().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?
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.
精彩评论