We use JIRA 7.0.9:
- Behind an IIS with AJP Connector (Redirected to /jira)
- And Adaptavist ScriptRunner for JIRA 4.2.0.5
- MSSQL2012
Now here is my Problem:
if i develop a Custemfield like this:
enableCache = {-> false}
import org.apache.log4j.Category
import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.user.ApplicationUser
import com.opensymphony.workflow.WorkflowContext
import com.atlassian.jira.issue.Issue
def Issue issue = issue
def customFieldManager= ComponentAccessor.getCustomFieldManager()
def versionCF= customFieldManager.getCustomFieldObjectByName("Versionsnummer")
def val=versionCF.getValue(issue)
def date=issue.getCreated().format('yyyyMMddHHmm')
def year =issue.getCreated().format('yyyy')
String ISSN = issue
def ISSNR = ISSN.split("-")
def STRG = ""
if (val){
STRG= year+"/"+ISSNR[1]+"/"+date+"/"+ISSNR[0]+"/v:"+val
} else {
STRG= year+"/"+ISSNR[1]+"/"+date+"/"+ISSNR[0]+"/v:"+"0"
}
if (STRG){
return STRG
} else {
log.error("Invalid: " + STRG);
}
return 0
I see only:
image2016-1-26 14:14:59.png
OK i Updatet now the script and say save:
I see that my test was successfull:
image2016-1-26 14:16:13.png
image2016-1-26 14:16:42.png
In the logfile it says to me:
2016-01-26 14:15:29,893 ajp-nio-8009-exec-49 ERROR USER 855x27396x1 rdr55x XXX.XXX.XXX.XXX /rest/scriptrunner/latest/canned/com.onresolve.scriptrunner.canned.common.StaticCompilationChecker [c.a.p.r.c.error.jersey.ThrowableExceptionMapper] Uncaught exception thrown by REST service: Could not initialize USERss com.onresolve.scriptrunner.runner.stc.ScriptCompileContext$ContextByName
java.lang.NoUSERssDefFoundError: Could not initialize USERss com.onresolve.scriptrunner.runner.stc.ScriptCompileContext$ContextByName
at com.onresolve.scriptrunner.runner.stc.ScriptCompileContext.fromLabel(ScriptCompileContext.groovy:86)
at com.onresolve.scriptrunner.runner.stc.ScriptCompileContext$fromLabel.call(Unknown Source)
at com.onresolve.scriptrunner.canned.common.StaticCompilationChecker.getContextFromParams(StaticCompilationChecker.groovy:81)
at com.onresolve.scriptrunner.canned.common.StaticCompilationChecker$getContextFromParams.callCurrent(Unknown Source)
at com.onresolve.scriptrunner.canned.common.StaticCompilationChecker.doScript(StaticCompilationChecker.groovy:103)
2016-01-26 14:15:29,908 ajp-nio-8009-exec-46 ERROR USER 855x27397x1 rdr55x XXX.XXX.XXX.XXX /rest/scriptrunner/latest/canned/com.onresolve.scriptrunner.canned.common.StaticCompilationChecker [c.a.p.r.c.error.jersey.ThrowableExceptionMapper] Uncaught exception thrown by REST service: Could not initialize USERss com.onresolve.scriptrunner.runner.stc.ScriptCompileContext$ContextByName
java.lang.NoUSERssDefFoundError: Could not initialize USERss com.onresolve.scriptrunner.runner.stc.ScriptCompileContext$ContextByName
at com.onresolve.scriptrunner.runner.stc.ScriptCompileContext.fromLabel(ScriptCompileContext.groovy:86)
at com.onresolve.scriptrunner.runner.stc.ScriptCompileContext$fromLabel.call(Unknown Source)
at com.onresolve.scriptrunner.canned.common.StaticCompilationChecker.getContextFromParams(StaticCompilationChecker.groovy:81)
at com.onresolve.scriptrunner.canned.common.StaticCompilationChecker$getContextFromParams.callCurrent(Unknown Source)
at com.onresolve.scriptrunner.canned.common.StaticCompilationChecker.doScript(StaticCompilationChecker.groovy:103)
2016-01-26 14:15:29,955 ajp-nio-8009-exec-46 ERROR USER 855x27403x1 rdr55x XXX.XXX.XXX.XXX /rest/scriptrunner/latest/canned/com.onresolve.scriptrunner.canned.common.StaticCompilationChecker [c.a.p.r.c.error.jersey.ThrowableExceptionMapper] Uncaught exception thrown by REST service: Could not initialize USERss com.onresolve.scriptrunner.runner.stc.ScriptCompileContext$ContextByName
java.lang.NoUSERssDefFoundError: Could not initialize USERss com.onresolve.scriptrunner.runner.stc.ScriptCompileContext$ContextByName
at com.onresolve.scriptrunner.runner.stc.ScriptCompileContext.fromLabel(ScriptCompileContext.groovy:86)
at com.onresolve.scriptrunner.runner.stc.ScriptCompileContext$fromLabel.call(Unknown Source)
at com.onresolve.scriptrunner.canned.common.StaticCompilationChecker.getContextFromParams(StaticCompilationChecker.groovy:81)
at com.onresolve.scriptrunner.canned.common.StaticCompilationChecker$getContextFromParams.callCurrent(Unknown Source)
at com.onresolve.scriptrunner.canned.common.StaticCompilationChecker.doScript(StaticCompilationChecker.groovy:103)
Now comes something i don't Understand. If i try the same on my Developer Host, Evrything is fine
In my productive JIRA the Field Works fine, but the Console not so i've tried it on my develop host.
Same Script whithout changes but the Version of JIRA isn't 7.0.9 it is
- v7.0.4#70113-sha1:3aced62
And here works everything fine ?!?!?
image2016-1-26 14:26:22.png
What is my mistake ???????????????????????????????
regards
Christoph
UPDATE:
If changed know from IIS to Apache and from AJP to HTTP/1.1 Connector and get a little bit diffrent Result:
2016-01-26 18:43:30,228 http-nio-8081-exec-11 WARN USER 1123x575x1 1m79tca XXX.XXX.XXX.XXX /rest/scriptrunner-jira/latest/scriptfields/11013/preview [c.o.scriptrunner.runner.ScriptFieldManagerImpl] Cannot get property 'name' on null object
java.lang.NullPointerException: Cannot get property 'name' on null object
at org.codehaus.groovy.runtime.NullObject.getProperty(NullObject.java:60)
at org.codehaus.groovy.runtime.InvokerHelper.getProperty(InvokerHelper.java:172)
at org.codehaus.groovy.runtime.callsite.NullCallSite.getProperty(NullCallSite.java:47)
at org.codehaus.groovy.runtime.callsite.AbstractCallSite.callGetProperty(AbstractCallSite.java:296)
at com.onresolve.scriptrunner.runner.ScriptFieldManagerImpl.getPreview(ScriptFieldManagerImpl.groovy:350)
at com.onresolve.scriptrunner.runner.rest.jira.ScriptFieldsEndpoint.previewScriptField(ScriptFieldsEndpoint.groo
vy:91)
... 3 filtered
at java.lang.reflect.Method.invoke(Method.java:497)
at com.sun.jersey.spi.container.JavaMethodInvokerFactory$1.invoke(JavaMethodInvokerFactory.java:60)
... 13 filtered
at com.atlassian.plugins.rest.module.RestDelegatingServletFilter$JerseyOsgiServletContainer.doFilter(RestDelegat
ingSer
vletFilter.java:178)
... 1 filtered
at com.atlassian.plugins.rest.module.RestDelegatingServletFilter.doFilter(RestDelegatingServletFilter.java:73)
... 106 filtered
at com.atlassian.plugins.rest.module.servlet.RestSeraphFilter.doFilter(RestSeraphFilter.java:40)
... 73 filtered
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
at java.lang.Thread.run(Thread.java:745)