I want to query jira issues by component in SQL, but i am surprised in the table of "jiraissue" , it is always NULL for the field of component,
What should i do in SQL? because we hope to know many metric by component.
thanks for your help
You may use the following query to get the count of issues per components:
SELECT count(ji.id), c.cname FROM jiraissue ji INNER JOIN nodeassociation na ON ji.id = na.source_node_id INNER JOIN component c ON na.sink_node_id = c.id GROUP BY c.cname
I hope it helps! :)
You can use the below query to fetch the components for a particular issue in JIRA
Please specify the valid jira issue key for below query:
note: in my case jira issue key is 'TEST-171'
(case when (LENGTH(CM.CNAME)>0) then CM.CNAME else ' ' end) AS COMPONENT
FROM JIRAISSUE JI, Project P, COMPONENT CM, NODEASSOCIATION NA where CM.PROJECT=P.ID AND JI.PROJECT = P.ID AND NA.SOURCE_NODE_ID=JI.ID AND NA.SINK_NODE_ID=CM.ID AND P.PKEY||'-'||JI.ISSUENUM= 'TEST-171'
Alternatively, this is achievable with SQL for JIRA plugin too:
SELECT COUNT(*) FROM PROJECTCOMPONENTS pc, ISSUECOMPONENTS ic WHERE pc.id=ic.projectcomponentid
The major difference among both approaches would be that they would return the same result for the JIRA administrator whereas for the rest of the users, the SQL for JIRA plugin would return the amount of issues per component and counting only the issues that each user is granted to see in JIRA.
Teams break work down in order to help simplify complex tasks. This is often done iteratively, with tasks being broken down into smaller tasks and so on until the work is accurately captured in well-...
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events