The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

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 Champions.
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

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

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
DEPLOYMENT TYPE
SERVER
TAGS
AUG Leaders

Atlassian Community Events