JIRA query filter needed to retrieve all the stories from capability

Harihara Prasath V February 29, 2024

Dear All,

I have the following scenario:

The following query retrieves multiple Capabilities in the project

project = XXXX AND issuetype in (Capability)AND PROGRAM INCREMENT = XXXX

The above query retrieves all the Capabilities from the project XXXX.  (For example, 2 Capabilities retrieved)

 

I want all the total stories under these capabilities(It means, I want to retrieve all the stories under the epics of these capabilities.).

 

project = XXXX and issueFunction in linkedIssuesOf("issuetype = capability and PROGRAM INCREMENT = XXXX", "is parent of") and issuetype = Epic

 

The above query retrieves all the epics.(For example 10 Epics retrieved)

 

Now, I want to retrieve all the stories from the above 10 Epics.  This is my request.

Thanks in advance for your support.

Regards,
Harihara Prasath.

1 answer

0 votes
Kalyan Sattaluri
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.
February 29, 2024

Hello @Harihara Prasath V 

You need to chain another function to get your issues under your epic like below.

Please try:

issueFunction in issuesInEpics("(project = XXXX and issueFunction in linkedIssuesOf('issuetype = capability and PROGRAM INCREMENT = XXXX', 'is parent of')
and issuetype = Epic")

 

If you run into syntax errors, you can save your Epics JQL as filter and refer to that to get your stories like below:

issueFunction in issuesInEpics("filter=12344")

 

Finally, please review below list to understand how to do multiple nested issuefunction syntax,

https://community.atlassian.com/t5/Jira-Software-questions/Proper-syntax-for-doing-quadruple-nested-issueFunction-JQL/qaq-p/1647631

Please let us know if issues, hope it helps.

 

 

Harihara Prasath V March 1, 2024

Thank you Kalyan for sharing your views.

Used this query as filter1:  project = key and issueFunction in linkedIssuesOf("issuetype = capability AND Program Increment = xx", "is parent of") and issuetype = Epic AND Program Increment = xx

and as per your suggestion saved this as a filter and invoked this into another query to retrieve all the stories for all the capabilities for the PI.

 

project = key and issuetype = story and issueFunction in issuesInEpics("filter = filter1")
Yet to assess about the results.

When checked the results randomly, I could see some stories belong to the other PI are retrieved but when I checked the respective EPIC, the epics were spanning across multiple PI's including the PI number which is given above in the filter1.  So bit confused on how to make a report only for that particular PI(Stories excluding the other PI's).

Kalyan Sattaluri
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 1, 2024

Hello @Harihara Prasath V 

Sounds like either your capability or epic have multiple PIs (I am guessing PI is a check box field) selected.

Do you want stories of Epics where Epic has only 1 PI selected?

 

Example:

Epic A -> PI - Q1 & Q2

-- Stories 1, 2, 3

 

Epic B -> PI - Q1

-- Stories 4, 5

 

You want only stories 4&5 and not 1,2,3?

Harihara Prasath V March 3, 2024

I want stories 1, 2, 3, 4 and 5.

Kalyan Sattaluri
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 4, 2024

Hello @Harihara Prasath V 

If your hierarchy is like this:

-Capability

--Epics

----Stories

And you have scriptrunner,

Then to find all Epics under capability, you can use:

issueFunction in portfolioChildrenOf("Project = XXXX and Increment = XX") and Increment = XX
(NOTE, Above I am checking increments for Capability and Epics because I am not sure where you increment field exists)
Then to find all All stories under these epics, save above as Filter as you have already done and reference it..
issueFunction in issuesInEpics("Filter = 1234") and issuetype = Story and status !=Canceled 
Like Harihara Prasath V likes this
Harihara Prasath V March 7, 2024

Thank you @Kalyan Sattaluri .

This query is not working for me however I used this query "issueFunction in issuesInEpics("Filter = 1234") and issuetype = Story and status !=Canceled " to retrieve all the stories 

For filter =1234, I used the below one to retrieve all the epics for all the capabilities for the particular PI

project = key and issueFunction in linkedIssuesOf("issuetype = capability AND program increment = xxxx", "is parent of") and issuetype = Epic AND program increment = xxxx

but when I retrieved, the stories retrieved are not correct / very difficult to validate the results.  Sometimes, it retrieves the capabilities with PI xx but the epics which are under the PI xx are under PI xy and the stories under the PI xx are under PI xy / PI xz.  Also, for few of the stories, if the PI field is not filled.  Hence I am confused on how to retrieve the correct data.

Kalyan Sattaluri
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, 2024

Hello @Harihara Prasath V 

Your first goal is to get the Filter = 1234 correct.

Did you try my earlier query:

issueFunction in portfolioChildrenOf("Project = XXXX and Increment = XX") and Increment = XX

This is giving you any results or No?

Suggest an answer

Log in or Sign up to answer