Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

Create a JQL Query for linked issues which ignores issues in specific Projects

David Young June 6, 2019

I am trying to create a JQL query to generate a list of tickets which are linked issues.  For example,

1. project = ABC

2. Issues in project which have linked issues

3. Restrict "linkedissues" to issues not in "project = ABC"

4. List show the "linkedissues"

 

I'm playing around with the following query:

project = ABC AND issueFunction in linkedIssuesOf("resolution = unresolved", "relates to")

 This generates a list of "project = ABC" tickets with unresolved links, but includes issues within ABC.  How do I generate a list that will exclude "linkedissues" in "project = ABC"?

 

The next question will be, how to I generate the list of the those restricted "linkedissues", not the list of issues in "project = ABC"? 

3 answers

1 accepted

1 vote
Answer accepted
David Young June 7, 2019

So the final answer to this query filter is:

project != "ABC" AND status not in (Closed, Canceled, Done, Resolved) AND issueFunction in linkedIssuesOf("resolution = unresolved AND project = ABC", "relates to")

 This will show all tickets which "project =ABC" are linked to that are not in a closed state and are still open for "project = ABC".  What this allows me, and anyone else to do, is keep track of work assigned to other teams that may, or may not, impact the progress of "project = ABC" and allow for easy follow-up as needed.

I am using this on a two projects tracking potential impediments to my team's success.

1 vote
Antoine Berry
Community Champion
June 7, 2019

Hi,

Maybe I have missed something but why would you not add the exclusion in the sub-query ? 

project = ABC AND issueFunction in linkedIssuesOf("resolution = unresolved AND project != ABC", "relates to")
David Young June 7, 2019

@Antoine Berry

 

What I trying to accomplish is create a list of tickets, not in my project, which are impacting the progress of my project.  For example, my software development team will need to create tickets for our system admins, platform technologies, and DevOps teams for action.  Then we link those tickets to the software development tickets my team is working on.  I'm putting a dashboard together that tracks our progress and ensures that the team doesn't fall behind or neglect a ticket to another team.  That is my goal.  Does that make sense?

Antoine Berry
Community Champion
June 7, 2019

Yes, that makes sense. I am not sure which project is your "main" though, I guess you want to track issues in your secondary project ? Anyway the above should work with some tweaks if necessary.

David Young June 7, 2019

Thanks @Antoine Berry that gets me halfway there.  The result of this is that it I get a list of my software development project ticket with "issuelinks>'relates to'" outside of my software development project.  Now the trick is to generate a list of those "relates to" tickets based on their connection to my software development project.

So my thought is to invert the query to something like this:

project ="Platform" AND issueFunction in linkedIssuesOf("resolution = unresolved AND project = ABC", "relates to")

This now generates the list of tickets in the Platform projects with links to my software development project. Thanks greatly, that helps me out huge.  I can even expand it to:

project != ABC AND issueFunction in linkedIssuesOf("resolution = unresolved AND project = ABC", "relates to")

Which will then show a list of all tickets created in my system which are open but have links to my software development project.  This is a broad list and has a lot of noise in it.  But I can even select specific  project get the results I want:

project in (DevOps, Platform, "Corp IT) AND issueFunction in linkedIssuesOf("resolution = unresolved AND project = ABC", "relates to")

This limits it to those tickets which directly impact my team.

 

@Antoine Berrythank you.  You got me all the way there in the end.  I appreciate it.

Like Antoine Berry likes this
Antoine Berry
Community Champion
June 7, 2019

Exactly you need to tweak the request to your needs, really good job there ! Glad I could set you on the right track. :)

David Young June 7, 2019

The query works to a great extent, however, not perfectly:

Updated Query error.PNG

As seen in the screen shot, the resolution to be included are those that are "unresolved", however, the query picks up tickets which are "Fixed", "Won't Fix", "Done", or "Canceled".  That is a problem. 

 

So I tried another approach to filter out the "Status" of ticket, but that doesn't work:

Query not working.PNG

As seen, the <issueFunction in linkedIssuesOf("status not in (Canceled, Closed, Done) AND project = ADQC", "relates to")> is not filtering out tickets with the "not in" statuses as desired. 

 

@Antoine Berryany thoughts or suggestions?  I'm getting the results I want, but I'm getting a lot of noise as well which will only distract and confuse people who review the dashboard.  Thoughts?

David Young June 7, 2019

I think i just figured out my issue.  I forgot the list which I am looking at.  This list is showing the status of the initial "project = ABC" query.  So the change should be:

(project = ABC AND Status not in (Closed, Done, Canceled)) AND issueFunction in linkedIssuesOf("resolution = unresolved AND project = ABC", "relates to")

 This seems to have worked as I wanted. 

Antoine Berry
Community Champion
June 11, 2019

Absolutely (sorry was oof) ! Also working with the resolution is best as a rule of thumb so that you are free to add statuses later.

1 vote
Scott Theus
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 6, 2019

Hi @David Young ,

Welcome to the Community! I'm working to improve my JQL skills, to this may or may not work, but have you tried this?

 

project = ABC AND (issueFunction in linkedIssuesOf("resolution = unresolved", "relates to") and project not in ABC)

 

-Scott

Scott Theus
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 6, 2019

BTW...I don't have a server instance, so I couldn't test it. 

David Young June 6, 2019

@Scott Theus 

 

The query you put looks straight forward, but it doesn't meet my needs.  At the end of the query, the "project not in (ABC) cancels out the opening part of the query.  I need to filter the issuelinks list.  That is the part that I find challenging.  The query you posted filters the same project, and cancels itself out.

 

I had tried a similar approach earlier with no success.

Scott Theus
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 6, 2019

I was afraid of that, thanks for trying it. 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events