How to get stories linked to epics that have a specific label?

Todd_Underwood March 11, 2020

Hi, 

We are running a project that has multiple epics associated with an overarching feature. We are labeling the epics with a label that denotes which feature it is a part of. 

As an example: 

  1. Epic 1 - label = foo
    1. Story 1
    2. Story 2
    3. Story 3
  2. Epic 2 - label = foo
    1. Story 4
    2. Story 5. 

I'm hoping we can write a query that looks something like this: 

epicLink is in (issueType =Epic & label is in (foo))

This would ideally return

  • Story 1
  • Story 2
  • Story 3
  • Story 4
  • Story 5

Is something like this possible?

 

Thanks

 

4 answers

3 votes
Christos Fousteris February 26, 2022

Hello,

i've come around this problem myself and the solution I found that seems to be working is the following:

issuetype = story and issueFunction in linkedIssuesOf("labels = foo", "is epic of")

This should return all Stories that are linked with issues having foo as label and their link type to the Story is Epic link.

I haven't tested this excessively but with a couple of alternative queries that looked like this...

issuetype = story and "Epic Link" in (Epic-1, Epic-2, Epic-x)

...where I had to specify the Epics with the right label one by one i got the same Stories so it should do the job indeed.

br, Christos

AT December 6, 2023

Thank you. I had the same question and I could compile the list of stories/bugs based on epic link instead of using label. 

2 votes
Jack Nolddor _Sweet Bananas_
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
March 12, 2020

Hi Paul,

Sadly you cannot achieve the desired search using standard features on Jira, you must go for a third-party app instead. Using i.e. JQL Booster Pack you can type the following:

 

Search for issues within Epics having a given label 'foo' :

issue IN issuesInEpics("labels = foo")

Search Stories within Epics having a given label 'foo' :

type = Story AND issue IN issuesInEpics("labels = foo")

 

Note that these are just an exaple, you must tune your query to fit your needs

Using this app you can also query other issues relations, check:

 

References:

 

Hope this helps you to create awesome queries <3

0 votes
Muhammad Ramzan(Atlassian Certified Master)
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 11, 2020

As described by Bharatha, if you want to achieve without any plugin , please follow his steps.

But what you want to can only be possible by plugins who provides built in jql queries like : 

JQL Search Extensions for Jira & reports 

 

 

if you use above plugin you can get your results as below

 

following query will return all stories, their subtasks part of epics where epic label=foo.

issue in allIssuesInEpic("labels=foo")

 

following query will only return stories part of epic where epic lable=foo

 

issue in allIssuesInEpic("labels=foo") and type=story
0 votes
Bharath Kumar Kappala
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 11, 2020

@Todd_Underwood If this is plain Jira without any add-on I am afraid the only possible way might be something like adding another label called foo-story to all the Issues liked to Epics in that project and add a JQL 

Project= "Project Name" and label = foo-story

Suggest an answer

Log in or Sign up to answer