jql query

Thrisha July 26, 2024

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"

1 answer

0 votes
Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 26, 2024

Hello @Thrisha 

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.

Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
July 28, 2024

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.

 

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events