ScriptRunner Enhanced Search Syntax

Daniel Gilio 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. 

1 answer

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
TAGS
AUG Leaders

Atlassian Community Events