It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How to use nested subquery to search issues

Board1: Level1_Query: Display specific set of initiatives (not all)

Project = "xyz" AND Type = "Initiative" AND Labels in (A01, B01,C01,D01)

Board 2: Level2_Query:  Display Epics for above set of initiatives linked by "Parent Link"

Project = "xyz" AND Type = "Epic" AND IssueKey In (Level1_Query)

Complete Query:  Project = "xyz" AND Type = "Epic" AND IssueKey In ('Project = "xyz" AND Type = "Initiative" AND Labels in (A01, B01,C01,D01)')

Board 3: Level3_Query: Display Epic and their next level children;stories/tasks (Not the Sub-Tasks)

Project = "xyz" AND Type NOT IN ("Initiative") AND IssueOfEpics (Level2_Query)

Board 4: Level4_Query: Display Stories/Tasks from level 3 with their sub tasks

Project = "xyz" AND Type NOT IN ("Initiative","Epic") AND IssueOfEpics (Level3_Query

----

Basically I want to implement nested queries in filter criteria. Any help would be appreciated.

3 answers

2 votes

Hello,

I am not sure from which plugin you have the IssueOfEpics function, but you could use filters as nested queries.

You could create a filter and then use it in JQL query like this:

filter = <your filter id>

ok let me give it a try

IssueOf Epics is just some text. Was trying to explain what I am trying to achieve.

Can you give me example for below:

 

This is what I am trying to achieve…

Board1_Initiatives_Query: Display specific set of initiatives (not all)

e.g. Project = "xyz" AND Type = "Initiative" AND Labels in (A01, B01,C01,D01) ‘---OK no Issues

Board2_Epics_Query:  Display Epics (only) for above set of initiatives linked by "Parent Link"

e.g. Project = "xyz" AND Type = "Epic" AND status In (“Open”,”In-Dev”,”In-QA”) AND issue in issuesParents (Board1_Initiatives_Query)

Board3_Ticket_Query: Display Epic and their next level; stories/tasks/defects (Not the Sub-Tasks) for above set of epics

e.g. Project = "xyz" AND Type NOT IN ("Initiative",”Sub-Tasks”) AND issueFunction in issuesInEpics(Board 2_Epics_Query)

And so on…

Like bjamesd likes this

Jira does not have such function as issuesParents or IssuesInEpic. You would need an add-on to have this functionality.

For example, you could use the Power Scripts.

https://marketplace.atlassian.com/apps/43318/power-scripts-jira-script-automation?hosting=cloud&tab=overview

Power Scripts have inbuilt functions needed by you:

https://confluence.cprime.io/display/JJUPIN/Pre-defined+JQL+functions

You are most welcome!

Does using a saved filter in another filter effect the search performance? 

0 votes

Hi,

I have been successful with . Jira query to get all the stories for a given set of 'Features' associated with a parent Epic.

Note that we have not created a parent 'Initiative', but simply associated a parent Epic to Child Epics 'Is Implemented By' relationship'.

 

ie.

  1. DES-001 (parent epic)
  2. DES-002 (child epic) - "Feature" Is Implemented By
  3. DES-003 (story) - associated with DES-002

 

The query to give me the list of all stories under DES-001 is:

issueLink in (linkedIssues(DES-001)) AND Type = Story ORDER BY "Epic Link"

The ORDER BY provides a visual grouping of stories per Epic (level 2).

 

The output would be DES-003 only. But if you had 50 level 2 epics, then it would return all the stories associated with Level 2 'Features' (of type Epic). Simply labelling the level 2 Epics as 'Features' would provide a way of tracking them accordingly.

 

Cheers.

While running the following query i.e issueFunction not in issuesInEpics("Clarity Project= P000000290 ABC XYZ 2.0")

getting the below error

  • Error in the JQL Query: Expecting operator but got 'Project'. The valid operators are '=', '!=', '<', '>', '<=', '>=', '~', '!~', 'IN', 'NOT IN', 'IS' and 'IS NOT'. (line 1, character 9)

some one can help me like how to override the spaces in subqueires?

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Jira

Jira Cloud for Google Sheets: Automatically Refresh Your Data!

Remember that time you realized it was possible to refresh your Jira data in Google sheets with just one click? What if we told you that you can now get the latest data with no clicks at all?! Zero! ...

7,369 views 33 29
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you