I have a list of issues that are connected to spesific components. Most are connected to several components, and sometimes the connection is wrong. Before changing or removing the component link, I need to know if the issues will still have a component connection if I remove a spesific connection.
So what I need is someting like this:
Project = xxx And Issuetype = xxx and component = xxx and Component.Count = 1.
Is this in any way possible with JQL?
Hi Ole,
It isn't possible to do this by default in JIRA using JQL, but you can do this by running the following query in your database:
SELECT p.pkey, ji.issuenum FROM component c JOIN nodeassociation na ON na.sink_node_id = c.id JOIN jiraissue ji ON ji.id = na.source_node_id JOIN project p on p.id = ji.project JOIN issuetype it ON it.id = ji.issuetype WHERE na.sink_node_entity = 'Component' AND na.source_node_entity = 'Issue' AND c.cname IN ('COMP-NAME') AND p.pkey = 'PROJECT-KEY' AND it.pname = 'ISSUE-TYPE' AND ji.id IN (SELECT ji.id FROM component c JOIN nodeassociation na ON na.sink_node_id = c.id JOIN jiraissue ji ON ji.id = na.source_node_id JOIN project p on p.id = ji.project WHERE na.sink_node_entity = 'Component' AND na.source_node_entity = 'Issue' GROUP BY ji.id HAVING count(c.id) > X) ORDER BY 2;
You just need to replace:
I know this is a big query, but I hope it helps.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.