Performance issue when using a filter with scripted function as a filter for Agile Board

Anton Kan October 8, 2014

I have the following filter:

project = MyProject AND type = Improvement AND status not in (Resolved, "Ready for QA", Closed, "In Progress", Postponed, Reopened) and issueFunction in linkedIssuesOf("filter = 'Epics I Need'", "is Epic of")

In its turn, the filter "Epics I need" looks like this:

project = MyProject and type = Epic and labels = LabelINeed

 

Being run alone, it executes quite fast (in about 2 sec) and returns 20 matching issues. But, when I set it as a filter for an Agile Board, the board never opens (the loader icon keeps spinning) which I guess is a performance issue.

The problem is definitely in the clause with the scripted function, as if I save the filter without it, just like this

project = MyProject AND type = Improvement AND status not in (Resolved, "Ready for QA", Closed, "In Progress", Postponed, Reopened)

then the board opens almost immediately, even though the number of matching issues is much higher (259).

I suspect this might be related to the fact that the 

issueFunction in linkedIssuesOf("filter = 'Epics I Need'", "is Epic of")

clause returns lots of matching issues (over 25,000) and only then they are filtered by other conditions down to 20. For a standalone filter that's not a problem (probably, thanks to paging, or something) but the board might try to load them all. Or maybe the board needs to run the query several times for some reason.

Any ideas on how to avoid this, or get the same result (all Improvements belonging to epics marked with a certain label) in other way?


5 answers

0 votes
Anton Kan January 10, 2015

We have upgraded to JIRA v6.3.9#6339-sha1:46fa261 and ScriptRunner 3.0.6. The issue is still the same, the only difference is that now, instead of just spinning the loading icon forever, JIRA explicitly says "Error - timeout". Will work on getting the logs...

0 votes
JamieA
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.
October 9, 2014

I would not use this to drive the board... but it worked fine for me when used as a quick filter. We'll really need the debug logging to get any further, but you'd do well to upgrade.

0 votes
Anton Kan October 8, 2014

ScriptRunner version is 2.1.3. I tried setting the query without the scripted function part project = MyProject AND type = Improvement AND status not in (Resolved, "Ready for QA", Closed, "In Progress", Postponed, Reopened) as the root filter for the board, and the scripted function part issueFunction in linkedIssuesOf("filter = 'Epics I Need'", "is Epic of") as a Quick Filter. Result is the same: the board opens fast (even though it contains 259 issues) bu when I try to activate the Quick Filter, a spinner appears and never stops. Will try to get the logs.

0 votes
Anton Kan October 8, 2014

Thank you for response, Jamie. Sorry for not providing versions. JIRA is v5.1.8#787-sha1:823790c. I don't have direct access to admin area to check ScriptRunner version and enable logs, will reach to our admins to do that. The filter is set not as a quick filter but as the root filter for the board. Will try to set it as a quick filter to see if there's any difference.

0 votes
JamieA
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.
October 8, 2014

Good question... can you add version information for everything. That query can definitely be made faster I think, although if it's 2s it should be 2s in greenhopper. Bumping up the logging: https://jamieechlin.atlassian.net/wiki/display/GRV/Getting%20Help#GettingHelp-Supportrequests - and rerunning will show if it's being run lots of times. Is it a quick filter query?

Suggest an answer

Log in or Sign up to answer