Search For Epics Not Linked to a certain project

Alistair Attrill
Contributor
October 31, 2023

Hello,

I am trying to find all the epics that exist that are not linked to a certain project epic.  

So i want to ensure that everything has a link to an epic in project X, so i need a list of them.

 

I have the below but it times out and im pretty sure its not right.

issuetype = epic and project = "YYY" AND issueFunction in linkedIssuesOf("project not in ("XXX")")

Also this is on cloud

Where am i going wrong? 

2 answers

0 votes
Hannes Obweger - JXL for Jira
Atlassian Partner
November 1, 2023

Hi @Alistair Attrill

this is a tricky one. The problem with your current JQL query

issuetype = epic and project = "YYY" AND issueFunction in linkedIssuesOf("project not in ("XXX")")

 is that 

issueFunction in linkedIssuesOf("project not in ("XXX")")

will return all issues that are linked to any issues in 

project not in ("XXX")

which I don't think is what you want.

What you would need is a function like hasIssueLinksIn(query) (or probably even better, hasNoIssueLinksIn(query) - which I don't think is available.

Taking a step back: Do I understand correctly that the epics that you want to find have

  • either one or more issue links to epics that are in project(s) that are different from XXX, or
  • no issue links at all?

Best,

Hannes

Hannes Obweger - JXL for Jira
Atlassian Partner
November 1, 2023

Actually @Alistair Attrill

here's another thought: I may be easier to query the epics that are linked correctly, and then basically "invert" the result.

So if I understand you correctly, this should give you the "correct" epics:

issuetype = epic and project = "YYY" AND issueFunction in linkedIssuesOf("project = XXX")

IIRC, you should be able to save this as a filter, and then use a 

filter != <your filter ID>

 clause to invert the result?

If this doesn't work for some reason, you could take the first query, add a label using bulk edit (like, I don't know, good-epic), and then query for labels != good-epic.

0 votes
BHANU TEJA
Contributor
October 31, 2023

Hi @Alistair Attrill 

 There are third party plugins (like ScriptRunner by Adaptavist) that extend the functionality of JQL and will allow you to find linked issues in other projects.

Alistair Attrill
Contributor
October 31, 2023

Yeah I have that app but i cant quite work out the JQL to make it happen.

BHANU TEJA
Contributor
October 31, 2023

Hi @Alistair Attrill  

please find the attachment executed in script runner

test123.png

Alistair Attrill
Contributor
November 1, 2023

Thanks for the effort on this, but I would like to list the TATA that are not linked to a GLOB-X.  Does that make the sense.


As every TATA should be linked to a GLOB.

BHANU TEJA
Contributor
November 1, 2023

Hi @Alistair Attrill 

find the Attached it might help you

smple.png

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
TAGS
AUG Leaders

Atlassian Community Events