ScriptRunner Enhanced Search Syntax

Daniel Gilio
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!
April 6, 2023

I am trying to find any Epics which are part of my prioject which have all of the Stories, Tasks and Bugs associated with them in the closed or done status.

I tried which runs:

project = PROJECT_KEY and issuetype = Epic and issueFunction in linkedIssuesOf("status = Done", "has Epic")

but I get the error: 

Search parsing timed out. You probably have a subquery that returns too many issues.

I then tried this to search for just Stories (which also runs):

project = ILP and issuetype = Epic and issueFunction in linkedIssuesOf("status = Done", "has Epic") and issueFunction not in hasLinkType("Epic-Story Link") or issueFunction in parentsOf("status = Done and issuetype = Story")

Same error:

Search parsing timed out. You probably have a subquery that returns too many issues.

I am using Atlassian Cloud.

When I try to use the IssuesinEpics function, I get the following error:

Not available with next-gen projects yet!
Issues in Epics will not return any issues, which are contained in epics of next-gen projects. The function is currently being implemented.

Any assistance would be appreciated. 

2 answers

0 votes
Martin Onis
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!
May 3, 2024

Quick filters can no longer use issueFunction. For that we now have to create ScriptRunner filters. Fair enough, but then those filters, if only used as Quick filters, should not be validated against the entire database but only against a boards filters.

Assuming `filter =` actually filters the current issues and does not execute a sub-selection over the entire database the time-out should not happen in actual use. Why then is it invalidated when tested over the entire database?

Example query:

issuetype in standardIssueTypes() and status not in (Done, Released, Closed)
or issueFunction in subtasksOf('status not in (Done, Released, Closed)')
0 votes
Romy Greenfield
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.
April 13, 2023

Hi Daniel 

In ScriptRunner for Jira Cloud Enhanced Search there are limitations on how long it takes to run searches. When your search requires processing and potentially retrieving a lot of information from Jira, it can lead to the search timing out. This can happen more commonly with instances with large numbers of issues. This is a common issue in Cloud.

When this happens, usually you can try to avoid as many issues being returned by your query by trying to be more specific. 

Maybe you could try something like the below and see if you get better results: 

issueFunction not in epicsOf("(issuetype = bug and status != done and status != closed) or (issuetype = story and status != done and status != closed) or (issuetype = task and status != done and status != closed") and issuetype = Epic and project = PROJECT_KEY

Also, the "Not available with next-gen projects yet!" is not an error - rather just a warning banner in case you are trying to use a team managed project with that function, as they are not currently supported. 

Hope this helps,

Romy

Suggest an answer

Log in or Sign up to answer