Forums

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

Search Issues with Lable in Epic

Felix Stepponat
I'm New Here
I'm New Here
Those new to the Atlassian Community have posted less than three times. Give them a warm welcome!
June 22, 2023

Hello together,

Is there a way to search Epics and the related stories by defining a filter criterion for Epics.

So I'm looking for epics with the label "XYZ" and I want to see all epics with this label and the corresponding stories that don't have the label.
Epic and Stories are linked via Epic Link.

Is there a JQL for this?

Thanks a lot for the help!

3 answers

2 accepted

2 votes
Answer accepted
Evgenii
Community Champion
June 22, 2023

Hi, @Felix Stepponat 

Unfortunately, it's impossible out of the box. Here is a good example that might help explain options - JQL-Query-Sub-Tasks-Parent-Epic-or-User-Story 

Basically you’ll need an add-on to achieve this. For example, scriptrunner can make it easily.

(issuetype = Epic AND labels in (test)) OR issueFunction in issuesInEpics("labels in (test)")

0 votes
Answer accepted
Adeel Shoukat
Contributor
June 22, 2023

Hi Felix

There are different way you can get detail about your story and epic link.
1. JQL:  Project = <ABC> and "Epic Link" = <Epic Name Link> and labels = <Lable Name>

2. The best way you can see complete over view through app

https://marketplace.atlassian.com/apps/1220703/panorama-lite-for-jira?tab=overview&hosting=cloud

Evgenii
Community Champion
June 22, 2023

Hi, @Adeel Shoukat 

It won't work for unspecified list of Epics, labels are set for Epic, not for issues in Epic. And @Felix Stepponat is using Server, not Cloud solution. Your plugin is only for Cloud.

1 vote
Hannes Obweger - JXL for Jira
Atlassian Partner
June 26, 2023

Hi @Felix Stepponat

welcome to the community!

as already suggested by others, 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:

  • If it's a one-off thing, you could first query the relevant epics, and then use the keys of these epics in a second query, in an ""Epic link" in (KEY-1, KEY-2, ...)" clause.

If you want to run your search dynamically, without manually stitching two queries together, you'll need extra tooling:

  • You might be able to use Jira Automation to "propagate" epic information down to the epic's children, and then use the respective field(s) on the children 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. Scriptrunner has already been mentioned; I've used JQL Search Extensions 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
June 26, 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'll create a new sheet with the issues that are potentially relevant to you, enable the default issue hierarchy (that's just one click), and then use JXL's filtering capabilities to narrow down to the issues that you're interested in:

epics-by-label.gif

Once you have your set of issues, you can work on these issues 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.

Since you've tagged your question for Jira Server: As you may have heard, app sales have ended for Jira Server. Are you planning to migrate to Data Center or Cloud? I'd strongly recommend that. If you need some more time, JXL is perfectly compatible with Jira Server; it's just that we need to generate a license for you. If the above looks interesting, just let me know, and I'll happily start a free trial for you.

Any questions just let me know!

Suggest an answer

Log in or Sign up to answer