I need to display test coverage by comparing two JQL query results

My effort is to run two JQL queries, that compare results and output a percentage.

eg

issueType = userStory AND created &gt;= 2015-09-01 AND created &lt;= 2015-12-31 AND project = project 1

vs

issueType = subTask AND created &gt;= 2015-09-01 AND created &lt;= 2015-12-31 AND project = project 1

With these results (my subTask is actually an issueType of Acceptance Test) I can see that query #1 returns 285 results and query #2 returns 245 results. Simple math shows me that I have 86.95% coverage. Great! Now how can I have this displayed on a Team Space in Confluence?

If you want to use one of the Jira gadgets to display percentage, you need to do a single query. I'm suggesting you query the subtasks, plus all the stories which don't have a subtask, in a single query. This will give you 245 subtasks and 40 user stories in the query for a total of 285. If you put that query into a Jira pie chart gadget and differentiate the pie slices by issuetype, you get a pie chart with the percentages you want.
The query above does what you want in my Jira system. However, it relies on the presence of the ScriptRunner plugin.JQL function "issueFunction not in hasSubtasks()". If you have the ScriptRunner add-on, or another add-on which lets you query issues without subtasks, this will work.

You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.