Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

Next challenges

Recent achievements

  • Global
  • Personal


  • Give kudos
  • Received
  • Given


  • Global

Trophy case

Kudos (beta program)

Kudos logo

You've been invited into the Kudos (beta program) private group. Chat with others in the program, or give feedback to Atlassian.

View group

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

Custom JQL - Jira 8.x compatible

I have a series of JQLs like:

package com.onresolve.jira.groovy.jql

import com.atlassian.jira.lucenelegacy.NumberTools
import com.atlassian.jira.lucenelegacy.NumericUtils
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.jql.operand.QueryLiteral
import com.atlassian.jira.jql.parser.JqlQueryParser
import com.atlassian.jira.jql.query.RangeQueryFactory
import com.atlassian.jira.util.MessageSetImpl
import com.atlassian.jira.web.bean.PagerFilter
import com.atlassian.query.operand.FunctionOperand
import com.atlassian.query.operator.Operator
import org.apache.log4j.Category
import com.atlassian.jira.util.MessageSet
import com.atlassian.crowd.embedded.api.User
import com.atlassian.query.clause.TerminalClause
import com.atlassian.jira.jql.query.QueryCreationContext
import org.apache.lucene.index.Term
import com.onresolve.jira.groovy.jql.AbstractScriptedJqlFunction
import com.atlassian.jira.issue.fields.CustomField
import com.atlassian.jira.issue.CustomFieldManager
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.user.ApplicationUser;


class HasInactiveAssignee extends AbstractScriptedJqlFunction implements JqlQueryFunction{
String getDescription() {
"Function to show only the inactive users"

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

String getFunctionName() {

def String subquery
MessageSet validate(User user, FunctionOperand operand, TerminalClause terminalClause) {
def messageSet = new MessageSetImpl()
return messageSet

Query getQuery(QueryCreationContext queryCreationContext, FunctionOperand operand, TerminalClause terminalClause) {
//User user=ComponentAccessor.getJiraAuthenticationContext().getLoggedInUser();
JiraAuthenticationContext context = ComponentAccessor.getJiraAuthenticationContext();
ApplicationUser applicationUser = context.getUser();
def booleanQuery = new BooleanQuery()
issues = getIssues(operand.args[0], applicationUser)
issues.each {Issue issue ->
def active = issue.assignee.isActive()
if ( !active )
booleanQuery.add(new TermQuery(new Term("issue_id", as String)), BooleanClause.Occur.SHOULD)
}catch(NullPointerException NPE){


return booleanQuery





This is not Jira 8.x compatible - and I have added/replaced (as statted on



moved → com.atlassian.jira.lucenelegacy.NumberTools

moved → com.atlassian.jira.lucenelegacy.NumericUtils


But some small code tweaks are missing. Any help out there?


Current error:


2019-05-03 14:26:42,832 http-nio-6060-exec-1 ERROR npn 866x32109x2 dktr5i 77.243.XX.XX /rest/issueNav/1/issueTable [c.a.p.r.c.error.jersey.ThrowableExceptionMapper] Uncaught exception thrown by REST service: Could not find which method <init>() to invoke from this list:<init>(int, [;,$1)
private<init>(int, [;)
org.codehaus.groovy.runtime.metaclass.MethodSelectionException: Could not find which method <init>() to invoke from this list:<init>(int, [;,$1)
private<init>(int, [;)
at groovy.lang.MetaClassImpl.chooseMethodInternal(
at groovy.lang.MetaClassImpl.chooseMethod(
at groovy.lang.MetaClassImpl.createConstructorSite(
at org.codehaus.groovy.runtime.callsite.CallSiteArray.createCallConstructorSite(
at org.codehaus.groovy.runtime.callsite.CallSiteArray.defaultCallConstructor(
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callConstructor(


0 answers

Suggest an answer

Log in or Sign up to answer
Community showcase
Published in Data Center

Introducing Data Center Community licenses

I'm Alison Huselid, Head of Product for Data Center at Atlassian. As we shared in our last post, we’ve been working on a solution for those of you who work for charitable non-profit organizations tha...

229 views 1 17
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you