I'm struggling to find a way to show issues filtered/sorted by the sprint they got completed in.
What do we want to show?
We have a dashboard where we show issues with the label "overrun". We're showing this for each sprint so we can see how many issues with this label got completed in each sprint.
Simplified Example:
Sprint 1: 5 completed issues were "overrun".
Sprint 2: 2 completed issues were "overrun".
Sprint 3: 8 completed issues were "overrun".
A lot of our issues don't get completed in the sprint they got started in so are in several sprints.
How did we set it up?
We have a custom field called "Resolved in sprint". For this field, we have the following automation set up:
When an issue gets transitioned to "Complete" the value of the field "Sprint" (last item in the list) gets copied to the field "Resolved in sprint".
This way we know which sprint an issue got resolved in and can show it on the dashboard mentioned above.
This is the problem:
This works well for issues that are only in one sprint. But when the "Sprint" field has more than one item it's causing issues. I thought I could solve it by using the last item in the field {{issue.sprint.last}}.
Unfortunately, Jira doesn't show the list of sprints in chronological order.
E.g. For one of our issues it looks like this:
"Sprint 62, Sprint 63, Sprint 64, Sprint 58, Sprint 59, Sprint 60, Sprint 61"
The sprint it got completed in is "Sprint 64" (the sprint with the highest number). I expected it to show last in the list but it seems quite random.
Question:
Is there any way to show which sprint an issue got completed in when it's been in several sprints?
Or is there a way to re-order the list of sprints (e.g. by sprint ID or creation date)
Any help appreciated. If there's an easier way to get this information instead of using a custom field and automation I'd be very happy to hear about it.