How to filter epics with specyfic tasks ?

Katarzyna Kacperska May 28, 2024

I want to search for epics that have tasks with a specific value in some custom field. (This custom field is field in the task, not in the epic)

4 answers

4 accepted

2 votes
Answer accepted
Charlotte Santos -Appfire-
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.
May 28, 2024

Hi @Katarzyna Kacperska 

I’m Charlotte, a support engineer at Appfire and I’m here to help you.

Unfortunately, natively, 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 get all Epics whose Tasks have a specific value in a custom field:

issue in epicOf("type = Task AND 'Custom field' = xxx")

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

We’ll be happy to help you! 😉

Katarzyna Kacperska May 31, 2024

Thank you for your answer.

Regards,

Kate

1 vote
Answer accepted
Rebekka Heilmann _viadee_
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
May 28, 2024

Hi @Katarzyna Kacperska 

this is not possible with Standard JQL, as you would need Subqueries. If the number of expected results isn't too long, you could

1. Switch to List View (-> Working with search results | Jira Software Data Center 9.16 | Atlassian Documentation)

2. Add "Epic Link" as a Column

3. Filter for the task (for instance: issuetype = Task and customfield = xxx)

You'll be able to get all Epics with matching Tasks from the List view. Again: only a viable workaround if the number of results is small.

If that's not enough, there are some Marketplace Apps that extend the JQL capabilities, ScriptRunner being one of them.

 

0 votes
Answer accepted
Hannes Obweger - JXL for Jira
Atlassian Partner
May 29, 2024

Hi @Katarzyna Kacperska

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 - so you'll need some kind of extra tooling.

A few directions forward:

  • Of course, you can always export your data and do some kind of post-processing outside of Jira.
  • You might be able to use Jira Automation to "propagate" child information up to the epic, and then use the respective field(s) on the epic to include them into your filter. Obviously, this would add a fair bit of complexity to your system, and I wouldn't personally recommend it.
  • If you're open to solutions from the Atlassian Marketplace, there's a number of apps that can help with your use case. First, there's a number of apps that extend JQL by additional functions, including hierarchy-related functions. Scriptrunner and JQL Search Extensions have been mentioned, but I believe there are others, too.
  • 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
May 29, 2024

 

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, enable the default issue hierarchy (that's just one click), and then use JXL filtering capabilities to narrow down to the epics that you care about:

epics-with-stories-from-different-teams.gif

(I'm using a custom field Team here, but it would work with any other field, too.) 

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!

Katarzyna Kacperska May 31, 2024

Thank you for your answer. I have Script Runner and managed to solve my problem. I used functions:
issuetype = Epic and issueFunction in epicsOf('issuetype = Zadanie and "Typ zadania" = WZP and status=GOTOWE')

Regards,
Kate

0 votes
Answer accepted
Katarzyna Kacperska May 29, 2024

Thank you very much for your replies.
I forgot to add that I have the Script Runner plugin, does it change anything?

I try queries like this:
project = XXX and issuetype = Epic and issueFunction  in epicsOf("issuetype = Task"  ) and issueFunction in epicsOf('"Typ zadania" = WZP') and issueFunction in epicsOf('"Status" = Gotowe')

Regards,

Kate

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
SERVER
TAGS
AUG Leaders

Atlassian Community Events