Forums

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

Query Stories and epics under a common parent

Brian Wooldridge August 30, 2023

Hi.  We are moving to Jira cloud soon, and are looking for a certain functionality.

 

Is it somehow possible to query for the stories under Epics that are under Initiatives that have a certain attribute?

 

ex.:  I want all stories and epics under initiatives with Product = 'ABC'

 

Maybe in Scriptrunner?

 

thanks,

bw

5 answers

1 accepted

0 votes
Answer accepted
mauricio.groth
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.
August 30, 2023

Hi @Brian Wooldridge 

I’m Maurício, a support engineer at Appfire and I’m here to help you.

Unfortunately, using JQL of Jira, you’ll not be able to do it dynamically.

In the app where my team works, JQL Search Extensions for Jira, you can use this query to find all your stories and epics under initiatives with Product = 'ABC'.

issue in childrenOfIssuesInQueryRecursive("Product = 'ABC' and type=Initiative", 2)

Please contact our support if you have any other questions about this query.

We’ll be happy to help you!
Best regards,
Maurício

Brian Wooldridge August 30, 2023

Thank you, Mauricio.

1 vote
Kate Kabir
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.
August 31, 2023

Hi @Brian Wooldridge 

I hope you are doing well. 

Potential workaround

However, you may be able to return issues linked recursively using the linkedIssuesOfRecursive() JQL function which the plugin provides and is documented here but we cannot guarantee if this will return the same structure that Portfolio provides.

Currently, Enhanced Search or ScriptRunner for Jira Cloud cannot return the full hierarchy from initiatives down due to the API's not existing to do this currently as explained above.

Jira JQL Search

Alternatively, Atlassian provides the portfolioChildIssuesOf function out-of-the-box and the Parent Link function to search for child issues of an issue in the Advanced Roadmaps/Portfolio.

You may wish to raise a ticket with Atlassian to ask them this question in case they can recommend any other ways to search for Advanced Roadmaps/Portfolio issues inside of Jira Cloud.

I hope this helps. :)

Kind Regards

Kate

0 votes
Hannes Obweger - JXL for Jira
Atlassian Partner
August 30, 2023

Hi @Brian Wooldridge,

unfortunately, this is trickier than one might think; as a "hierarchical query", it would really require some kind of join or subquery, which isn't available in plain Jira/JQL.

A few directions forward:

  • You might be able to use Jira Automation to "propagate" initiative information down to the initiatives's children and grandchildren, and then use the respective field(s) on the children and grandchildren to include them into your filter. Obviously, this will add a fair bit of complexity to your system.
  • There's different apps from the Atlassian Marketplace that can help with that. First, there's a number of apps that extend JQL by additional functions, including hierarchy-related functions. JQL Search Extensions has been mentioned before; I've used it a few times and it works well.
  • Alternatively, you could try one of the more hierarchy-focused apps from the Marketplace. These apps typically have their own ways of figuring out parent/child relationships between issues, and provide more powerful ways of searching through issue hierarchies. I myself work on such an app, in which your use case would be easy to solve - I'll provide more details below.

Hope this helps,

Best,

Hannes

Hannes Obweger - JXL for Jira
Atlassian Partner
August 30, 2023

Just to expand on the last point, this is how this would look in the app that my team and I are working on, JXL for Jira. Put simply, you'd create a sheet with all issues that are potentially relevant to you, model your hierarchy (that's just a couple of clicks), and then use JXL filtering capabilities to narrow down to the issues that you care about:

initiative-by-component.gif

(I'm using components here, but it would work the same way with any other field.)

Once you have your list of issues, you can work on these directly in JXL (much like you'd do in e.g. Excel or Google Sheets), trigger various operations in Jira, or export them for further processing.

Any questions just let me know!

0 votes
Brian Wooldridge August 30, 2023

In this scenario, there are multiple Incidents with a custom field "Product = 'ABC'".  Each of those has Epics, each of those Epics have stories.

I would like to return all the Initiatives/Epics/Stories, from the Initiative down, without knowing the Initiative key.  Initiative.product = 'ABC'

It's confusing.

0 votes
Vishal
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.
August 30, 2023

Hi @Brian Wooldridge 

Not sure if I get your question correctly but feel free to correct me, if I am wrong. I could think of two scenarios

1. You have a parent issue & all other connected to them, in that case all you need to do is run advance jql as "Parent Link" = <Your_Parent_Issue_Key>

2. You have a custom field called product filled as ABC in all issues, then just run JQL as Product = 'ABC'

This should give you all the desired issue list.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events