-
Bug
-
Resolution: Unresolved
-
Minor
-
None
-
Jenkins 2.124
Using shared library steps (vars folder script), in not a call method, when trying to call .next() on a enum Status{}, an exception is thrown:
hudson.remoting.ProxyException: groovy.lang.MissingMethodException: No signature of method: [LStatus;.getAt() is applicable for argument types: (java.lang.Integer) values: [1] Possible solutions: getAt(java.lang.Integer), getAt(groovy.lang.Range), getAt(groovy.lang.EmptyRange), getAt(groovy.lang.ObjectRange), getAt(groovy.lang.IntRange), getAt(java.util.Collection) at org.jenkinsci.plugins.scriptsecurity.sandbox.groovy.SandboxInterceptor.onMethodCall(SandboxInterceptor.java:131)
Steps to reproduce:
- Create shared library step
- declare enum Status with some states
- define method checkState(){}
- print Status.next() inside the method checkState(){}
Basically, equivalent of this piece of code that runs normally on https://groovyconsole.appspot.com/ :
enum Status{
open, indev, developed, deploydev, verified, deploystage, resolved
}
def taskStatus='developed'
print Status."${taskStatus}".next()
RESULT:
[deploydev]