Search Issues by Epic with a certain Label

Andy Zimmermann April 9, 2020

Hi there

Is there a way to write a a baisc jql-filter on issues that also checks a property of their epic? Or could it  be done via the script-runner-plugin?

Background story: We often log work on epics of issues in the current sprint, if the work cannot directly be associated to a task. Like sprint planning etc.
But only on epics that allow the logging of work (i.e. do not contain label=logWorkNotAllowed)

So either a) start with the actual issues (showing epic-link-column in results)
Filter issues by a certain sprint (sprint=XYZ) then filter by epics which do not have the label "logWorkNotAllowed"
or b) list epics directly
Filter issues by "issueType = Epic AND labels != logWorkNotAllowed" then select only those which have a connected issue in sprint=XYZ

In Datebase-Terms we need to Join the issues with their epics, and apply filters on both.
Is that possible?

Thanks for your help!
Kind Regards Andy

 

3 answers

1 accepted

3 votes
Answer accepted
Jack Nolddor _Sweet Bananas_
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
April 9, 2020

Hi Andy,

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:

 

a) Start with the actual issues (showing epic-link-column in results)
Filter issues by a certain sprint (sprint=XYZ) then filter by epics which do not have the label "logWorkNotAllowed"

Sprint = XYZ AND issue NOT IN issuesInEpics(' type = Epic AND labels = logWorkNotAllowed ')

>> This Will return the issues but not the Epics

 

b) list epics directly
Filter issues by "issueType = Epic AND labels != logWorkNotAllowed" then select only those which have a connected issue in sprint=XYZ

type = Epic AND (labels != logWorkNotAllowed OR labels IS EMPTY) AND issue IN epicsOf(' Sprint = XYZ ')

>> This will return the Epics but not related issues

 

You can easyly save above queries as filters, give them a meaningful name, and then combine both results by tying:

filter = "You named filter for Epics" OR filter = "You named filter for issues"

 

(*) Note that this is just an exaple, you must tune above queries 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

Kind regards

Andy Zimmermann April 9, 2020

Thats exactly the information I needed :)
I'll check it out!

Thank you very much

Jack Nolddor _Sweet Bananas_
Marketplace Partner
Marketplace Partners provide apps and integrations available on the Atlassian Marketplace that extend the power of Atlassian products.
April 9, 2020

You're welcome

Like Andy Zimmermann likes this
1 vote
Vikrant Yadav
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 9, 2020

@Andy Zimmermann  i think you are using wrong label field , try to "labels" instead of label

 

try this :-  issuetype = Epic AND labels != CoreApp

Andy Zimmermann April 9, 2020

oh thats actually just a typo. Fixed it. thanks for the catch!

but the main issue still stands :)

Vikrant Yadav
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
April 9, 2020

@Andy Zimmermann You can create Sprint custom field and filter issues via JQL.

Andy Zimmermann April 9, 2020

I don't understand how that would help.

What I need, is this kind of issue filter query:
"sprint = XYZ AND labelsOfEpic != logWorkNotAllowed"But ofc there is no such thing as "labelsOfEpic", or is there a way to filter by the issues associated epic properties additonally to filtering the issue property (sprint)?

Or alternativly: the epic-filter
"issueType = Epic AND labels != logWorkNotAllowed AND issuesConnectedToEpicHaveSprint = XYZ", where again I could not find any way to query the associated issues of an epic (i.e. the fake label: issuesConnectedToEpicHaveSprint )

Ianna April 26, 2021

How to search for the item with one of its labels as "SYNC"? I mean, there are several labels added to one item, I would like to search it out with one of its labels. At this time, "=" is not work.

0 votes
Björn Eriksson January 10, 2024

Hi
Is this possible to achieve with ScriptRunner?

Suggest an answer

Log in or Sign up to answer