How to Identify Issues that belongs to any Sprint in Jira Data Center

Still need help?

The Atlassian Community is here for you.

Ask the community


Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.

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

Purpose

The purpose of this article is to show how to identify issues with Sprint and those that does not belong to any Sprint. This can be done via JQL and SQL.

Queries were created for PostgreSQL and they may require syntax adjustments for other DB products.

Solution

  1. All the issues that have been put into some sprint:

    1. JQL:

      Sprint is not EMPTY
    2. SQL:

      select ji.id, concat(P.pkey,concat('-',ji.issuenum)) from jiraissue ji join project P on P.id = ji.project join customfieldvalue cv on ji.id=cv.issue join customfield cf on cf.id=cv.customfield where cf.cfname='Sprint'
  2. All the issues that have not been put into any sprint:

    1. JQL:

      Sprint is EMPTY
    2. SQL:

      select I.id,concat(P.pkey,concat('-',I.issuenum)) from jiraissue I join project P on P.id = I.project where I.id not in (select ji.id from jiraissue ji join customfieldvalue cv on ji.id=cv.issue join customfield cf on cf.id=cv.customfield where cf.cfname='Sprint')
  3. Issues that belong to a specific sprint:
    1. JQL (if you provide the name here it will return issues for all sprints with the same name):

      Sprint = 'my sprint name'
    2. SQL query to list the Jira issues associated to the "my sprint name" sprint:
      select ji.id, concat(P.pkey,concat('-',ji.issuenum)) as issuekey, ads."NAME", ads."ID"
      from jiraissue ji
      join project P on P.id = ji.project
      join customfieldvalue cv on ji.id=cv.issue
      join customfield cf on cf.id=cv.customfield
      join "AO_60DB71_SPRINT" ads on cv.stringvalue=cast(ads."ID" as text)
      where cf.cfname='Sprint'
      and ads."NAME" = 'my sprint name'
      order by issuekey;


Last modified on Jul 11, 2024

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.