Portfolio
These functions are only available if Portfolio for Jira is installed.
After first install the version of ScriptRunner containing these functions, a full reindex is required, otherwise they will only show results for issues updated from that point.
portfolioChildrenOf
portfolioChildrenOf(Subquery)
Find issues that are children of the specified subquery.
For example, given the following Portfolio hierarchy:
Theme
Initiative
Epic
Story
To find all Initiatives that belong to Themes in a certain status:
To find all children of Themes:
This function does not traverse the link from Epic to Story. To also find stories you could combine multiple functions. First of all, create and save a query that finds all children of the Themes or Initiatives, e.g. save the above function as Children of initiatives.
Then the following function will also the stories of the epics:
It can be useful to find high-level items that have not been properly placed in a structure. To search for Initiatives with no Themes:
portfolioParentsOf
The converse of portfolioChildrenOf
. Finds parent issues of the provided subquery.
To find all themes of unresolved Epics you might use:
Continuing the example from above where we are looking for issues that did not fit the hierarchy, we can search for any Themes that have no children. Notice the not in.
In simple terms, this looks for all Themes that are not the parent of an Initiative.
If you want to start from Stories, you need to create a combination of queries. Let’s search for open Initiatives of closed Stories: