How to filter for all epics with a certain label and all issues in these epics

C E September 25, 2016

Hi,

 

What I want:

I am using JIRA agile with Scriptrunner installed and want to do the following:

for an agile Board, I would like to create a JQL filter that mainly filters all epics with a certain label. And the filter should also include all issues in these epics. I want to do this because in my JIRA project there are multiple big topics and I want to create an agile board for one of these topics.

E.g. there is the big topic "test". I would then create epics and add the label "test" to those epics. Additionally I would create issues in these epics (but of course the have no or different labels).

I want them all now to turn up in my agile board.

 

What I already tried:

  • Create a filter to filter all epics (stored as JQL Filter "MyEpicFilter")
project = MyProject AND issuetype = Epic AND labels in (Test) AND resolution = Unresolved
  • Create another filter which uses the first filter as subfilter
issuefunction in linkedIssuesOf("filter = 'MyEpicFilter'")
  • and then combine both to get the issues and epics
issuefunction in linkedIssuesOf("filter = 'MyEpicFilter'") OR (filter = "MyEpicFilter")

but this doesn't work and creates a cyclical reference.

 

In the end I want to end up with an agile board where epics can be added by simply creating a new epic and assigning the label to it.

How can this be solved?

8 answers

1 accepted

2 votes
Answer accepted
Phill Fox
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 25, 2016

Hi Claudius Eisele

Can you confirm what name you are saving the final filter as? I suspect that you are trying to implement 

issuefunction in linkedIssuesOf("filter = 'MyEpicFilter'") OR (filter = "MyEpicFilter")

whilst JIRA still thinks you are working on "MyEpicFilter"

 

If the final filter is a different name to "MyEpicFilter" then we need to dig deeper. But I can confirm that I tested your approach on a local instance making sure I named each filter as I went and it worked fine.

Hope this helps.

 

Phill

C E September 25, 2016

Hi @Phill Fox [Adaptavist],

Thanks for your answer.

I did not yet save the final filter, I was just typing it into the advanced JQL filter input in JIRA. So the name is free to define - but yes it should be something different as "MyEpicFilter". For example: "MyBoardFilter".

 

I even could not save it because I would need to execute it first but it always ends up with the following error message:

Field 'filter' with value 'MyEpicFilter' matches filter 'MyEpicFilter' and causes a cyclical reference, this query can not be executed and should be edited.

Do you have any idea what is different from your filter and mine if your one works?

Phill Fox
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
September 25, 2016

Hi Claudius Eisele

I suspect JIRA still thinks it is working the filter 'MyEpicFilter'  I would suggest the next step is to copy the JQL and open a new tab for the issues filter and paste in to there. In this way you are breaking the connection with 'MyEpicFilter'. This was how I built my test case to match yours.

I have just done what you described of typing the content in to the issues Filter after defining the included filter and got the same error message that you showed.

Phill

C E September 25, 2016

Thanks @Phill Fox [Adaptavist],

 

executing the filter now worked - my fault. sad

 

It now works, really great! smile

I even wanted to include the subtasks so I built the following query:

issuefunction in linkedIssuesOf("filter = 'MyEpicFilter'") OR (issueFunction in subtasksOf("issuefunction in linkedIssuesOf(\"filter = 'MyEpicFilter'\")")) OR (filter = "MyEpicFilter") ORDER BY Rank ASC

 

Just if someone else wants to do such a query.

 

Thanks again,


Claudius

John Knecht
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!
January 24, 2017

Wow, thanks for this answer. It was EXACTLY what I was looking for. I modified the final filter to include "is epic of" as below:

issuefunction in linkedIssuesOf("filter = MyEpicFilter", "is epic of") OR filter = MyEpicFilter ORDER BY Rank ASC

Like Trixie Johnson likes this
7 votes
Matt Dodge
Contributor
January 3, 2018

Same question as Dion Jones, is there any way to do this without ScriptRunner? I have the same use case as OP. Want to be able to tag/label an epic and have all of the issues of that epic appear on a certain board.

7 votes
Dion Jones
Contributor
February 17, 2017

Can this be done without ScriptRunner?

3 votes
Jimmy Fleming
Contributor
May 27, 2019

Ditto.

3 votes
Jay Sea January 26, 2018

Ditto to Matt Dodge....following.

2 votes
Jonas Jensen
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!
July 4, 2019

Any solution for this yet?

1 vote
Karen July 3, 2020

Anyone found a way to do this without a plug-in?

0 votes
Roman Osatinski July 16, 2020

issuefunction is not coming up Screen Shot 2020-07-16 at 3.19.33 PM.png

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events