Forums

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

SQL Query to find issue count by Issue Types between dates

Rob B
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
August 19, 2020

I need a query so i can find out how many issues have been created grouped by Issue Types and this is only in the last 12 months.

Example Output:

Issue Type A | 146
Issue Type B | 16
Issue Type C | 118

Thanks

 

1 answer

0 votes
John Pisani July 12, 2022

I went searching myself and found the question but no reply. Better late than never.

This example is for SQL Server. 

SELECT it.pname AS 'Issue Type', it.pstyle AS 'Type', COUNT(i.ID) AS 'Count'
FROM issuetype it
LEFT JOIN jiraissue i ON it.ID = i.issuetype
WHERE i.CREATED > dateadd(month,datediff(month,0,getdate())-12,0)
GROUP BY it.pname, it.pstyle
ORDER BY COUNT(i.ID) DESC

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
TAGS
AUG Leaders

Atlassian Community Events