How to find the total number of sprints and identify the oldest closed sprints

Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

Summary

The total number of sprints, including closed sprints, in your instance can contribute to problems with the closedSprints() JQL function, and overall performance degradation related to slow sprint cache population.

Solution

If you experience problems, use the following queries to check the total number of sprints, and identify the oldest sprints so they can be deleted if no longer required.

Find the total number of sprints

Query tested on PostgreSQL and MySQL. You may need to adapt this query for other databases.

PostgreSQL

1 2 SELECT count(*) FROM "AO_60DB71_SPRINT";

MySQL

1 2 SELECT count(*) FROM AO_60DB71_SPRINT;

Find the oldest sprints

Query tested on PostgreSQL and MySQL. You may need to adapt this query for other databases.

PostgreSQL

1 2 3 4 SELECT *, CAST(TO_TIMESTAMP("END_DATE"/1000) AS date) AS end_date_human_readable FROM "AO_60DB71_SPRINT" where "CLOSED" = true order by "END_DATE";

MySQL

1 2 3 4 SELECT * FROM AO_60DB71_SPRINT where CLOSED = true order by END_DATE
Updated on April 2, 2025

Still need help?

The Atlassian Community is here for you.