You might already know that "AND" statements are often optimized in many query languages. Resulting rows from preceding "AND" statements get transferred to the next "AND" statement so that it will operate on a smaller set, thus reducing query time dramatically. But this is not possible with custom Jira functions. Assume that your Jira instance has 100K issues, 100 of them are assigned to you and you are running the following JQL:
|assignee = currentUser() AND issue in tts.issuesHaveAllSlasMet()|
You would expect that tts.issuesHaveAllSlasMet() should analyze only 100 issues that are assigned to you. Unfortunately, this is not possible with the current JQL framework of Jira. So TTS analyzes all of the 100K issues, and this causes query time to take much longer than expected.
Long query times. If a timeout occurs, you will get no results.
Unfortunately, there is no current solution to this problem, but we are working on possible workarounds.