Custom JQL - problem JqlQueryFunction Edited


I'm struggling with your your simplest example of the custom JQL i found on gist.

package com.onresolve.jira.groovy.jql

import com.atlassian.crowd.embedded.api.User
import com.atlassian.jira.jql.query.QueryCreationContext
import com.atlassian.jira.util.MessageSet
import com.atlassian.query.clause.TerminalClause
import com.atlassian.query.operand.FunctionOperand

class ABC extends AbstractScriptedJqlFunction implements JqlQueryFunction{
String getDescription() {
"gets issues with ABC in the summary"

List<Map> getArguments() {
"description": "Subquery",
"optional": false,

String getFunctionName() {

Query getQuery(QueryCreationContext queryCreationContext, FunctionOperand operand, TerminalClause terminalClause) {


actually I even had to remove method 

 def String subquery
MessageSet validate(User user, FunctionOperand operand, TerminalClause terminalClause) {

because it was throwing an execption. The page with existing functions got populated properly.

2018-01-09 09:07:14,565 http-nio-8080-exec-11 WARN za577 547x1411314x2 176k4ob, /rest/plugins/1.0/com.onresolve.jira.groovy.groovyrunner-key [c.o.scriptrunner.runner.ScriptRunnerImpl] Script /var/atlassian/application-data/jira/scripts/com/onresolve/jira/groovy/jql/abc.groovy failed to load/compile: startup failed: /var/atlassian/application-data/jira/scripts/com/onresolve/jira/groovy/jql/abc.groovy: 32: Method 'validate' from class 'com.onresolve.jira.groovy.jql.ABC' does not override method from its superclass or interfaces but is annotated with @Override. @ line 32, column 5. @Override ^ 1 error


Afer then after I re-scan the scripts I get ugly error and the page with function failed to load.

I am running Server instance of JIRA v7.3.1 with Script Runner 5.0.14.
Any help appreciated, I spend on it hours with no success. I also need to unable the addon and enable back to correctly scan the new version. 

Many thanks,

1 answer

1 vote

Have you tried the example from our documentation here? That works for me. It's unlikely the one in the gist works as that is a much older example.

From the error it looks like your putting the file in the correct place. Note you may want to rename your file to uppercase ABC.groovy so it matches the class name.

If that doesn't work then you may want to try upgrading ScriptRunner to a later version. I can't think of any bugs that are in 5.0.14 though that would cause this.

Many thanks @Adam Markham [Adaptavist]

renaming the file to match the class name did the trick. I can see now function in the list of functions. Thanks

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Feb 07, 2019 in Marketplace Apps

A Timeless Love Story

It started as any story starts, on a normal, rainy day.   Admin meets App, and her name was Klok2, and like any first relationship we were both trying to make it work but neither one knew what...

465 views 8 27
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you