Forums

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

Help required to form a combined JIRA Query!

Vijay Kumar March 31, 2025

I am trying to find issues as per the below conditions & their individual queries as follows & those queries work absolutely fine. They are time tested.

1) Story/Defect/Task is in 'COMPLETED' status, but subtask/s are in 'OTHER THAN COMPLETED' status.
project = CDP AND "Assigned Team" = "Chimera - Core API Team" AND issuetype in (Story, Defect, Task) AND status = "Completed" OR issueFunction in subtasksOf("status != Completed") AND sprint in openSprints()

2) Story/Defect/Task is in 'OTHER THAN COMPLETED' status but subtask/s are 'COMPLETED' status.
project = CDP AND "Assigned Team" = "Chimera - Core API Team" AND issuetype in (Story, Defect, Task) AND status != "Completed" OR issueFunction in subtasksOf("status = Completed") AND sprint in openSprints()

3) Story/Defect/Task is in 'OTHER THAN COMPLETED' but subtask/s are also 'OTHER THAN COMPLETED' status.
project = CDP AND "Assigned Team" = "Chimera - Core API Team" AND issuetype in (Story, Defect, Task) AND status != "Completed" OR issueFunction in subtasksOf("status != Completed") AND sprint in openSprints()

Now I want to put all of these in one query as i need to find issues which meets all these criteria. Hence, I am writing below queries. None of it worked properly,

THE QUERIES WHICH DIDN"T WORK:

1) project = CDP AND "Assigned Team" = "Chimera - Core API Team" AND issuetype in (Story, Defect, Task) AND sprint in openSprints() AND ( (status = "Completed" OR issueFunction in subtasksOf("status != Completed")) OR (status != "Completed" OR issueFunction in subtasksOf("status = Completed")) OR (status != "Completed" OR issueFunction in subtasksOf("status != Completed")) )

2) project = CDP AND "Assigned Team" = "Chimera - Core API Team" AND issuetype in (Story, Defect, Task) AND sprint in openSprints() AND ( (status = "Completed" OR issueFunction in subtasksOf("status != Completed")) AND (status != "Completed" OR issueFunction in subtasksOf("status = Completed")) AND (status != "Completed" OR issueFunction in subtasksOf("status != Completed")) )

3) project = CDP AND "Assigned Team" = "Chimera - Core API Team" AND issuetype in (Story, Defect, Task) AND sprint in openSprints() AND ( (status = "Completed" OR issueFunction in subtasksOf("status != Completed")) OR (status != "Completed" OR issueFunction in subtasksOf("status = Completed")) OR (status != "Completed" OR issueFunction in subtasksOf("status != Completed")) )

4) project = CDP AND "Assigned Team" = "Chimera - Core API Team" AND issuetype in (Story, Defect, Task) AND ( (status = "Completed" OR issueFunction in subtasksOf("status != Completed")) OR (status != "Completed" OR issueFunction in subtasksOf("status = Completed")) OR (status != "Completed" OR issueFunction in subtasksOf("status != Completed")) ) AND sprint in openSprints()

2 answers

0 votes
Pasam Venkateshwarrao
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.
March 31, 2025

Hi @Vijay Kumar 

Welcome to the community,can you try this JQL Example

project = ABC AND "Assigned Team" = "Test Team"
AND issuetype in (Story, Defect, Task)
AND sprint in openSprints()
AND (status = "Completed" OR issueFunction in subtasksOf("status != Completed"))

 

Hope this helps

Vijay Kumar April 1, 2025

Hi @Pasam Venkateshwarrao 
Thanks much for the reply. This query and so far whatever we have tried works at only User Story, Task & Defect level. It is unable to find a subtask underneath these story, defect & task, whether it's in completed status or other than completed status. 
I now started getting doubt that, whether issueFunction is a valid one we are using.

 

0 votes
Mirek
Community Champion
March 31, 2025

Hi @Vijay Kumar 

The reason that it does not work is probably because you mix of AND/OR conditions without properly grouping them. Specifically, you use multiple OR conditions for each scenario but didn't make sure the logic correctly grouped the status of the parent AND subtasks together.

Try this one.. 

project = CDP AND "Assigned Team" = "Chimera - Core API Team" AND issuetype in (Story, Defect, Task) AND sprint in openSprints() AND ( (status = "Completed" AND issueFunction in subtasksOf("status != Completed")) OR (status != "Completed" AND issueFunction in subtasksOf("status = Completed")) OR (status != "Completed" AND issueFunction in subtasksOf("status != Completed")) )

Vijay Kumar March 31, 2025

@Mirek 
I am sorry, this is giving me zero results again. :(

Query.pngResults.png

Mirek
Community Champion
March 31, 2025

Could you please test it on a fresh Search not on Boards as a Quick filter? The reason is that it might be combined with your Board filter and making a bigger mess in logic. So first of all is to check if query is working overall.  

Vijay Kumar March 31, 2025

@Mirek Could be the reason. Lemme try that right away!

 

Vijay Kumar March 31, 2025

@Mirek  bad luck again :(...tried with other boards as well. same results

 

Mirek
Community Champion
March 31, 2025

Well not Boards just focus on a simple search in Issue Navigator. We need to make sure that the query itself is getting some results and not an error or something (or maybe there are no results but query is ok.. ?) Are you sure that there are some issues that would be included in the result? 

Vijay Kumar April 1, 2025

@Mirek  Thank you for the reply. Yes.i tried this in all way. I am really surprised that, none of our approaches are working. I manually making sure, we have all the test data & scenarios to test this query filter. I have created some examples to test all the scenarios. This really surprises me now.

 

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