Forums

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

Combining two jql queries

Lakshmi CH
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.
September 9, 2020

Hello Team,

Any suggestions on below JQL ?

JQL query 1 :

project = md AND issuetype in (Bug, “Change Request”) AND status not in (Closed, “Additional Requestor Information”, “Waiting For Release Management”, “Release Management In Process”, “Regression Testing In Process”, “Waiting on Dependency”) AND (BA is not EMPTY OR SE is not EMPTY OR QE is not EMPTY) AND cf[10206] != “Data Engine” AND resolution = Unresolved

Result is 115 tickets

JQL query 2 :

 

project = MD AND issuetype in (Bug, “Change Request”) AND (labels in (APAC-PSTC) OR component in (form-calculation, form-network-sourcing, single-qual, multiple-qual, extra-records, “Future Batch”))

Result is 15 tickets

When I combine them it cuts down to 62 tickets, but should really be 100 tickets (115 - 15) : 100.

Here is the combined query I was trying: Trying to add "not in" in both components and labels. There is "in" second query, when combing both adding "not in"


project = md AND issuetype in (Bug, “Change Request”) AND status not in (Closed, “Additional Requestor Information”, “Waiting For Release Management”, “Release Management In Process”, “Regression Testing In Process”, “Waiting on Dependency”) AND (labels not in (APAC-PSTC) OR component not in (form-calculation, form-network-sourcing, single-qual, multiple-qual, extra-records, “Future Batch”)) AND (BA is not EMPTY OR SE is not EMPTY OR QE is not EMPTY) AND cf[10206] != “Data Engine” AND resolution = Unresolved

1 answer

0 votes
Gustavo Félix
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.
September 10, 2020

Hi @Lakshmi CH 
Just for curiosity, how many tickets does the second query with a "not in" shows you?
Something like:

project = MD AND issuetype in (Bug, “Change Request”) AND (labels not in (APAC-PSTC) OR component not in (form-calculation, form-network-sourcing, single-qual, multiple-qual, extra-records, “Future Batch”))

Lakshmi CH
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.
September 10, 2020 edited

Hi @Gustavo Félix ,

 First query : 116

 Second query : 41

 but the combined query is not giving 116 -41 = 75. it reducing to 55.

I am really sorry for giving the mathematical calculations.   I don’t fully understand that. I know it’s combining with the ‘status not in’ piece but I still don’t understand why that greatly reduces the # of tickets.

---------------

and trying with this also

(project = md AND issuetype in (Bug, "Change Request") AND status not in (Closed, "Additional Requestor Information", "Waiting For Release Management", "Release Management In Process", "Regression Testing In Process", "Waiting on Dependency") AND (BA is not EMPTY OR SE is not EMPTY OR QE is not EMPTY) AND cf[10206] != "Data Engine" AND resolution = Unresolved) AND NOT filter = query2

 

---------

tried this also, saved the first filter with query1 and second with query2.

filter in (query1) AND NOT filter in (query2)

Gustavo Félix
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.
September 10, 2020

Something that I just saw is that empty labels or empty components dont show when you do the "not in" . 

I had 40 issues without components, 1 with label 'A' and 1 with label 'B'. 
If I execute labels not in A, the number of issues is 1.

Can you check if you have a similar case?

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
VERSION
8.7.1
TAGS
atlassian, jira product discovery, jpd premium, product management, idea management, product discovery, jira premium, product planning, atlassian community, product development, roadmap planning, product prioritization, feature management

Introducing Jira Product Discovery Premium ✨

Jira Product Discovery Premium is now available! Get more visibility, control, and support to build products at scale.

Learn more
AUG Leaders

Atlassian Community Events