Hey everyone,
I'm looking for a way to write a SQL query that gets a list of issue types per project. For example:
project XYZ --> Uses issue types A, B, C
project ABC --> Uses issue types D, E, F
.
.
.
.
etc.
So far, I'm thinking that I will need to use 3 tables to get this sort of data:
project
issuetype
jiraissue
The query below allows us to get a list of projects that use a certain issue type by passing the issue type ID, but I'm looking for an easier way to simply pull all issue types that a project uses by maybe passing the project ID?
SELECT DISTINCT P.pname, P.pkey, P.lead AS project
FROM jiraschema.project as P
INNER JOIN jiraschema.jiraissue as J on J.PROJECT = P.ID
INNER JOIN jiraschema.issuetype as I on I.ID = J.issuetype
WHERE J.issuetype= 10106
Thank you!