Forums

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

JIRA query using output of another query

S Sheikh November 23, 2022

Requirement -

I need to extract list of stories for a specified list of epics of a particular fixversion.

Query 1 - type=Epic and fixversion="V1" and project=ABC

Query 2 - All the stories linked to list of epics from above query - 

Can I have a combined query for the above 2 queries?

2 answers

1 accepted

0 votes
Answer accepted
Gaurav
Community Champion
November 24, 2022

Hello @S Sheikh 

Welcome to the community!!

For this purpose, kindly check the 'Advanced search reference JQL functions'. there are options like parentEpic(), linkedIssue, linkedIssues() which can be used to create the combination query as per requirement.

Please note that the query in query is still not natively possible, and would require a plugin.

Kindly accept the answer if this helps.

-GG

Trudy Claspill
Community Champion
November 24, 2022

The specified Advanced Search functions will not fulfill the requirement. parentEpic function requires an explicit list of issue keys, and the requirement is to use a dynamically generated list of Epic issue keys.

This cannot be done without a third party app.

Like Ellen Li likes this
0 votes
Fabio Racobaldo _Herzum_
Community Champion
November 24, 2022

HI @S Sheikh ,

welcome to the Atlassian community!

Please try the following query :

issue IN issuesInEpics(' type=Epic and fixversion="V1" and project=ABC  ')

Hope this helps,

Fabio

S Sheikh November 24, 2022

Hi Fabio ...Many Thanks for your response.

I am not sure if the above query serves my purpose.

Let me explain the problem - I have 10 Epis and these epics have about 50 stories linked under these -Please note the stories are linked to epic using the Epic Link

I want to write a query that fetches all the stories under these epics using the fixversion of the parent epic.

Fabio Racobaldo _Herzum_
Community Champion
November 24, 2022

Hi @S Sheikh , please try the provided query. It should retrieve all issues in your epic. If you need to retrieve just stories you could use :

type=Story and issue IN issuesInEpics(' type=Epic and fixversion="V1" and project=ABC  ')

Fabio

Trudy Claspill
Community Champion
November 24, 2022

@Fabio Racobaldo _Herzum_ 

issuesInEpic doesn't appear to be a native advanced search function for Jira Cloud. Are you using a third party app to get that?

Sunny Ape
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.
November 24, 2022

@Trudy Claspill 

issuesInEpics is one of the JQL additions provided by ScriptRunner

Trudy Claspill
Community Champion
November 24, 2022

Thank you for pointing that out @Sunny Ape 

We should always mention if our suggested solutions require a third party app ;-)

Also, in that case the syntax is incorrect. It needs to be "issueFunction in issuesInEpic"

S Sheikh December 12, 2022

Thanks Trudy, David and Fabio. This worked for me. Many thanks.

Really appreciate all of you. Means a lot to me. 

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events