On {JIRA_GOME}/scripts/ create this folders:

For example: ../jira_home/scripts/com/onresolve/jira/groovy/jql

Then add the groovy file with the new JQLFunction, exmaple: ABC.groovy

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
import org.apache.lucene.search.Query

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

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

 String getFunctionName() {

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


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


Then Go to Addons –> ScriptRunner –> Script JQL Functions –> and then press “Scan”

That’s all!

Posted by:.

5 replies on “How to add new custom JQL Function with ScriptRunner

    1. why not?

      Probably you can use the same classes in Groovy like the REST Endpoints.
      See Custom JQL Function (Scriptrunner): https://scriptrunner.adaptavist.com/4.3.3/jira/custom-jql-functions.html

      And see REST Endpoints (Scriptrunner): https://scriptrunner.adaptavist.com/4.3.3/jira/rest-endpoints.html

      Or these classes (Scriptrunner):

      Otherwise (Java) you can follow these instructions to create the JQL function: https://developer.atlassian.com/jiradev/jira-platform/guides/search/tutorial-adding-a-jql-function-to-jira

      And import the JAVA rest classes.

      Best regards


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s