jql query
Asked by Thrisha:

I have 2 project "NOT"AND "CH"

In "NOT" project we have "Non Software" as issue type and in "CH" project we have "RC","CRB".

Here in "CH" project "RC" is linked to "CRB" with link type "is fixed by" and "Non Software" is linked to "RC" with link type "is caused by".

I need a query to show "Non software" issues that are linked to "RC" and that "RC" that are linked to "Non software" shouldn't have a link type "is fixed by" and also show "Non software" issues with link type "EMPTY"


Answers:
author: Trudy Claspill
body: Hello [@Thrisha](/t5/user/viewprofilepage/user-id/5525972)

In the tags you added "addon-com.j-tricks.jql-plugin". Do you mean that you have the JQL Tricks Plugin in your environment?

You also have tags for "pocketquery" and "jqlquerybuilder". Those don't apply to Jira Cloud, but your other tags indicate that this is a question about Jira Cloud.

Can you clarify/confirm if this question applies to Jira Cloud or Jira self-hosted, and which third party apps you have available in the environment.

In the end, I don't think there is a way to satisfy your requirement if those are the only JQL extension apps you have available and you are using Jira Cloud. I tried to work through the problem and ran into limitations.

The more complicated portion is:
> show "Non software" issues that are linked to "RC" and that "RC" that are linked to "Non software" shouldn't have a link type "is fixed by"

Working from the RC issues back to the "Non software" issues:

1. Get RC issues that have no "is fixed by" links

project=CH and issueType=RC and not jqlt.links.type = "is fixed by"

2. Get RC issues that have a link to "NOT"/"Non Software" issues

project=CH and issueType=RC and jqlt.links.project = "NOT" and jqlt.links.issuetype = "Non Software"

3. Get the RC issues that meet both those criteria.

project=CH and issueType=RC and jqlt.links.project = "NOT" and jqlt.links.issuetype = "Non Software" and not jqlt.links.type = "is fixed by"

4. Get the "NOT"/"Non Software" issues that have links to the RC issues that are within #3.

This is where we hit a wall. There is no way to take the query from #3 and use it as input to get the "Non software" issues.

project="NOT" and issuetype="Non software" and *linked-issues-of(query from #3)*

With another app like Adapativist's Enhanced Search you can embed filters in some functions:

project="NOT" and issuetype="Non software" and *issueFunction in linkedIssuesOf("filter='query from #3' ")*

linkedIssuesOf() is a function that returns the issues linked to the issues specified by the filter in the parentheses. So, the filter from #3 get you the list of qualifying RC issues. linkedIssuesOf would get all the issues linked to those RC issues. Combining that with the rest of the filter reduces the list to only the "Non software" issues from the "NOT" project that are linked to appropriate RC issues from the CH project.

I don't know, though, if it would actually work to embed into linkedIssuesOf() a filter that include JQL Tricks keywords.

The final part of your requirement is simple, if I understood it correctly.

In you post you said:
> also show "Non software" issues with link type "EMPTY"

Do you mean the "Non software" issues that have no links to other issues? Or do you have a link type that is named "EMPTY"? Assuming you mean issues that have no links, that is relatively easy with JQL Tricks:

project="NOT" and issueType="Non software" and jqlt.links.count=0

Disclaimer: all of the above is based solely on reviewing the JQL Tricks documentation. None of it has been tested in a Jira Cloud environment.

comments: author: Trudy Claspill
body: It appears that you asked a question related to this same filter, and in that post you indicated that you have Adaptavist's Enhanced Search.

<https://community.atlassian.com/t5/Jira-questions/Query-in-synchronizing-the-filter-used-in-dashboard/qaq-p/2767268>

That information would have been useful to me when I was working on a response to your question here.


Tags: addon-com.j-tricks.jql-plugin

cloud

filter

jira-cloud

jql

jqlquerybuilder

pocketquery