Team Board and complex filters using ScriptRunner functions

Kelley Cooper
Contributor
January 23, 2023

I'm trying to create a saved filter for use with a Team Board; I cannot seem to figure out how to form the JQL correctly such that the Team Board where I'm using the filter doesn't consider the filter to be a "complex filter".

In words, I'm trying to retrieve:

  1. All the Epics in a specific project with a specific value in a field PLUS
  2. All the child issues within the retrieved Epics PLUS
  3. All the Sub-tasks within the child issues (#2)

I've tried everything I can think of, lastly being making each of the above a separate filter, then grouping them all together for the Board's Saved Filter; still doesn't work.

#1 Saved the following JQL with Name= Epics

project = ABCD AND "Field Name" = Customer ORDER BY Rank

#2 Saved the following JQL with Name= Backlog Items

issueFunction in issuesinEpics("filter = Epics") ORDER BY Rank

#3 Saved the following JQL with Name= Subtasks

issueFunction in subtasksOf("filter = BacklogItems") ORDER BY Rank

I think created one last filter which calls all 3 filters above:

filter = x OR filter = y OR filter = z ORDER BY Rank

I still get the complex filter notation on the associated Board which means the Create Sprint and Complete Sprint buttons are greyed out. I'm no JQL expert and am at my wits end!!!!

thank you in advance for any help!!!

1 answer

1 accepted

1 vote
Answer accepted
Trudy Claspill
Community Leader
Community Leader
Community Leaders are connectors, ambassadors, and mentors. On the online community, they serve as thought leaders, product experts, and moderators.
January 23, 2023

Hello @Kelley Cooper 

The issue is Query #2. It is not constrained to specific projects. You will need to update that one to include "project=ABCD" as part of its criteria.

Epics can have child issues in other projects so without that constraint Jira is interpreting #2 to mean the child issues could be in any project on your Jira system.

You will need to do the same with Query #3.

Kelley Cooper
Contributor
January 24, 2023

Thank you so much for your response, @Trudy Claspill !! I tried so many different variations I couldn't "see the forest for the trees" ;)

I settled on the following; the filter is no longer being interpreted as complex, so the Create Sprint and Complete Sprint buttons are no longer greyed out for those associated with the Manage Sprints permission...hooray!!!

#1 Saved the following JQL with Name= Epics

project = ABCD AND "Field Name" = Customer ORDER BY Rank

#2 Saved the following JQL with Name= Backlog Items

project = ABCD AND issueFunction in issuesinEpics("filter = Epics") ORDER BY Rank

#3 Saved the following JQL with Name= Subtasks

project = ABCD AND issueFunction in subtasksOf("filter = BacklogItems") ORDER BY Rank

Suggest an answer

Log in or Sign up to answer