ScriptRunner: How to custom extend aggregate JQL function

Hubbitus March 23, 2018

I've try implement custom JQL function, just copy/paste `ScriptRunner-5.3.9.jar:/com/onresolve/jira/groovy/jql/AggregateExpression.groovy` into `$JIRA_HOME/scripts/com/onresolve/jira/groovy/jql/AggregateExpressionWithGroupBy.groovy` and change class name to `AggregateExpressionWithGroupBy` and change name:

@Override
String getFunctionName() {
"aggregateExpressionWithGroupBy"
}

 After hot `scan` link new function appeared in functions list:

image.png

By search results it looks like working, but I got error "Negative array index [-1] too large for array size 0" instead of totals:

image.png

 

If I try just extend some JQL function I got cast error, because of different classloaders I think:

class AggregateExpressionWithGroupBy extends AggregateExpression {

error:

Cannot cast object 'com.onresolve.jira.groovy.jql.AggregateExpression@2d03fc56' with class 'com.onresolve.jira.groovy.jql.AggregateExpression' to class 'com.onresolve.jira.groovy.jql.AggregateExpression'

image.png

1 answer

0 votes
Hubbitus March 23, 2018

deleted

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events