Skip to content

Instantly share code, notes, and snippets.

@senthilsweb
Last active March 31, 2024 16:21
Show Gist options
  • Save senthilsweb/f303ca41099e3f8019a08329e3cd7954 to your computer and use it in GitHub Desktop.
Save senthilsweb/f303ca41099e3f8019a08329e3cd7954 to your computer and use it in GitHub Desktop.

Variables

select distinct(status) from defects
select distinct(priority) from defects
select distinct(COALESCE(labels, 'NULL')) from defects 
select distinct(release) from defects
SELECT COALESCE(engineer, 'NULL')
FROM (
    SELECT DISTINCT assignee as engineer FROM defects
    UNION
    SELECT DISTINCT reporter as engineer FROM defects
) AS sub
ORDER BY engineer ASC;

Dashboard Queries

Total Defects

SELECT COUNT(1) FROM defects 
WHERE priority in ('P1','P2','P3','P4', 'P5')
AND release='Version 1.1'
AND status in ('Open')

Defects by labels

select labels, count(labels) as count from defects 
where release='Version 1.1'
--AND status in ($defect_status)
--and assignee in ($assignee)
--and reporter in ($reporter)
group by labels
order by count desc
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment