How can we write nested queries in Jira

Udita Sharma March 7, 2017

Hello,

 

Can somebody please help me with the following scenario: 

How could something like this could be achieved in Jira?

Query: project = project-name  AND type = Sub-task (type = Story AND status changed TO "Development Done")

I want Sub-tasks as my results but filter them according to the changed status at a Story.

Hierarchy:

  • Story
    • Sub-tasks

If I write, 

Query: project = project-name  AND type = Sub-task AND status changed TO "Development Done" 

then the query filters the data according to the Status changed at sub-tasks.

Thanks a lot in advance.

 

Regards,

Udita

 

3 answers

2 votes
Thomas Schlegel
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 7, 2017

Hi Udita,

with plain Jira, this is not possible. If you have the Scriptrunner plugin you can do the following:

project = project-name and issuetype = sub-task and issueFunction in subtasksOf("project = project-name and status changed to Development Done") 

 

Udita Sharma March 7, 2017

Hello Thomas

Thank you for your quick response, actually I have a little more complicated problem. Can you please help me with that.

I, actually, want only the Subtasks which were created after the Story status was changed to Development Done. How to include that filter as well?

Regards,

Udita

Thomas Schlegel
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 7, 2017

hmm, that's tricky. I don't know, if I can find an answer for that. I will try and answer later again. Don't have much time at the moment to try things out.

Thomas Schlegel
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
March 8, 2017

Back again smile 

Sorry Udita, but I didn't find a function that is able to compare the status changed date from the main issue with the creation date of the subtask. Even with Scriptrunner. It might be possible to add a scripted field, maybe someone else has a solution for that?

0 votes
Mel Dett August 3, 2018

looking for help. 

I have a query resulting in a list of Epic Links

Now I want to list the labels within the list of Epic Links.

Seems like a nested filter or sub-query or something. 

 

Any thoughts?

0 votes
Sam Hall
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 7, 2017

This is a compromise and not very flexible, but you could add the "Sub-tasks" column to your filter results.

That way you can search for stories meeting particular criteria and see a list of the sub-tasks under those:

sub-tasks-search.png

 

Suggest an answer

Log in or Sign up to answer