Forums

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

Combining JQL querey resulting different value

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 1, 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

 

 

2 answers

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

Post a new question

0 votes
Nic Brough -Adaptavist-
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

Having this conversation duplicated fragments the suggestions and support you might get, so I suggest everyone here moves over to https://community.atlassian.com/t5/Jira-Software-questions/Combining-two-jql-queries/qaq-p/1477068 which has more information and activity.

0 votes
Florian
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 1, 2020

Well for sure there is some optimization possible. But the easies way without paper and pencil is to write a huge statement like this:

(query1) and not (query2)

Replace the words query1 and query2 with you actual 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

Hi @Florian , no luck, giving different results.