Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

How do use JQL to query all Stories and Tasks completed in the Last Sprint ?

Michael Green
Contributor
March 8, 2026

How do use JQL to query all Stories and Tasks completed in the Last Sprint ?  Without manually hard-coding the name of the last sprint ?

 

project = PMO AND issuetype in (story,task, SUB-TASK) AND Sprint in closedSprints() AND STATUS = Done and sprint = 1008 ORDER BY ASSIGNEE

2 answers

0 votes
Trudy Claspill
Community Champion
March 8, 2026

Hello @Michael Green 

How would you determine which sprint was "the last sprint"?.

The content of a sprint is not restricted to a project/space. It isn't even truly restricted to a Board. Technically Jira allows any work item to be added to any sprint, as long as the user has the necessary permissions.

Also there is not a native Jira JQL function to filter for "last sprint" since there is no standard definition for what that is.

Can you provide more information about your use case and the problem you are trying to solve by creating this filter?

0 votes
Ollie Guan
Community Champion
March 8, 2026

Hi @Michael Green ,

Yes, you can, but it depends on which “Analytics” you mean and how exact you want the “last sprint” logic to be.

With only Jira Cloud Standard native features:

 

  • You can approximate “last sprint” by date + closedSprints() in a filter, then use dashboards and reports.

  • You cannot have a purely dynamic “lastClosedSprint()” JQL function.

With Atlassian Analytics (SQL):

  • You can precisely compute “the most recent closed sprint” and list all completed Stories/Tasks.

BTW, this app can basically cover your needs for “last completed sprint” reporting, but in a different way than JQL.

https://marketplace.atlassian.com/apps/1233252/sprint-reviewer-pro-automate-sprint-reports-data-insights?hosting=cloud&tab=overview

 

Trudy Claspill
Community Champion
March 8, 2026

@Ollie Guan 

Isn't Analytics for Jira available only for Enterprise subscriptions?

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
STANDARD
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events