3

In JIRA Agile I know I can look at the sprint report to see all the issues completed in that sprint and manually count them.

I can also query for all issues completed in a particular sprint like: project = MYPROJECT AND status = Done AND Sprint = nn

However what I want is a count of the total number of issues completed in each sprint. Is there a way to do this with JQL?

Chris R
  • 2,464
  • 3
  • 25
  • 31
  • While I'm not sure with JQL, it tells you in a message box how many issues were completed in the sprint when you click 'complete sprint' – WearyWanderer Apr 07 '16 at 13:03
  • Yes I've seen that although don't think there's any obvious way to get that number once you've already completed the sprint. I want to find out how many were completed in the 30 previous sprints without manually counting for each. – Chris R Apr 07 '16 at 14:01

3 Answers3

4

I have set up a saved filter with: project = MYPROJECT AND status = Done AND Sprint is not EMPTY AND issuetype in (Bug, Story)

Then on my dashboard I have added a Two Dimensional Filter Statistics gadget using:

  • the above query
  • X-axis: Issue type
  • Y-axis: Sprint
  • Sort Direction: Descending - to show most recent sprints at the top
  • Show Totals: Yes

enter image description here

This is actually better than just the total I wanted as I can also see the breakdown of bugs and stories in each sprint.

Chris R
  • 2,464
  • 3
  • 25
  • 31
  • I've realised there is an issue with this that some bugs/stories are counted in more than one sprint. The Sprint field can have multiple values if a bug/story isn't completed in a sprint and is moved into the next sprint. – Chris R May 03 '16 at 15:05
  • I'm struggling with this now. There doesn't seem to be a clean, consistent way to determine what sprint an issue that lived in multiple sprints was closed in (one would assume it's the most recent sprint, but not sure how to pull that out programatically) – Max Cascone Oct 10 '17 at 21:47
  • @MaxCascone I never found a way to get this information in JIRA so abandoned using the chart which was a shame as it would have been a good summary. Possibly one of the JIRA plugins might let you get the last sprint for an issue. Alternatively you could export the result of a query to a spreadsheet and then MAX() the sprint field. – Chris R Oct 12 '17 at 09:46
  • Hey Chris R can you take a look at this question and see what you think? I'd appreciate it. https://stackoverflow.com/questions/47944678/using-jira-query-language-from-klipfolio-to-query-jira-api-for-number-of-rejecte?noredirect=1#comment82859155_47944678 – Chris Mazzochi Dec 22 '17 at 16:45
  • @ChrisMazzochi had a look but I've not used the API much. Looks like the answer someone has added since could help you out. – Chris R Jan 03 '18 at 09:00
2

You can use the JQL query:

project = PRJKEY AND Sprint is not empty

and then use the pie chart (via Export > Chart > Pie Chart) to get the numbers:

enter image description here

Wim Deblauwe
  • 25,113
  • 20
  • 133
  • 211
  • I didn't know about the Export option so thanks for that. However I think this would give all issues in the sprint, not just ones that got completed in it which I need. Also as the Sprint field can have more than 1 value if an issues is not completed in the sprint and gets moved into the next one I think your chart would counted some issues twice. – Chris R Apr 07 '16 at 16:36
1

what about trying somehting like this:

project = MYPROJECT AND status = Done AND Sprint is not empty

i guess tha if the issue is added to a sprint you set this fiel up, if not it is empty. If true, this can help

Oldskultxo
  • 945
  • 8
  • 19
  • I've already got that exact query but was looking for a way to get it to 'group by' the sprint to get overall counts for each. – Chris R Apr 07 '16 at 16:36
  • 1
    Just save your filter, and then go to boards and add a pie gadget using thst filter. The result eill be what you need – Oldskultxo Apr 07 '16 at 21:46
  • That's what I did although I used a _Two Dimensional Filter Statistics_ gadget instead as it was better for what I wanted. See [the answer](http://stackoverflow.com/a/36482144/184325) I posted after commenting on your answer. – Chris R Apr 08 '16 at 07:59