Questions for Confluence license has expired.

Please purchase a new license to continue using Questions for Confluence.

script not working

 
1
0
-1

I wrote this script based on examples, but its not working and im getting an error.

when i tried to set a constant value to the the "avo" field, it was working fine. 


def leftToRightUrgency = [
    // left Assignee ---> right Assignee
    "דחופה" : "Emegency",
    "גבוהה" : "High",
    "רגילה" : "Medium",
    "נמוכה" : "Low"
]

def urgency = leftToRightUrgency["IL ZD".issue.עדיפות?.value] ?: "High"


on["""avo"""].issue.customFields.urgency.value = urgency


the error message doesnt say anything specific.


please assist. 

    CommentAdd your comment...

    1 answer

    1.  
      1
      0
      -1

      Can you provide the details of the error.  It also seems that the encoding of the customField name can result in problems


      Can you change the name into the custom field id?


      Let us know

      1. ben friedman

        the error is not specific. it says: 

        Check the documentation for more details.


        is the ID the identifier of the custom field?

        if so, should it be

        ["IL ZD".issue.360005568420?.value]?:"High"

      2. ben friedman

        Francis Martens (Exalate) 

        the error is not specific. it says: 

        Check the documentation for more details.


        is the ID the identifier of the custom field?

        if so, should it be

        ["IL ZD".issue.360005568420?.value]?:"High"

      3. Francis Martens (Exalate)

        What is the stack trace - it is revealing a lot.

        Can you give it a try and see if it help
        also a debug.error statement can provide more information like



        debug.error("The customfield is ${...}")

        Where ... is the value you would like to show.

      4. ben friedman

        im not sure where to look for the debug trace. 


        stack trace

        com.exalate.domain.exception.editor.ScriptEditorException: com.exalate.admin.editor.errors.mappings.script at com.exalate.replication.services.replication.mapping.MappingService$$anonfun$1.applyOrElse(MappingService.scala:294) at com.exalate.replication.services.replication.mapping.MappingService$$anonfun$1.applyOrElse(MappingService.scala:276) at scala.runtime.AbstractPartialFunction.apply(AbstractPartialFunction.scala:38) at scala.util.Failure.recoverWith(Try.scala:236) at com.exalate.replication.services.replication.mapping.MappingService.executeInScriptRule(MappingService.scala:276) at com.exalate.replication.services.replication.mapping.MappingService.$anonfun$receive$8(MappingService.scala:181) at scala.concurrent.Future.$anonfun$flatMap$1(Future.scala:307) at scala.concurrent.impl.Promise.$anonfun$transformWith$1(Promise.scala:41) at scala.concurrent.impl.CallbackRunnable.run(Promise.scala:64) at akka.dispatch.BatchingExecutor$AbstractBatch.processBatch(BatchingExecutor.scala:56) at akka.dispatch.BatchingExecutor$BlockableBatch.$anonfun$run$1(BatchingExecutor.scala:93) at scala.runtime.java8.JFunction0$mcV$sp.apply(JFunction0$mcV$sp.java:23) at scala.concurrent.BlockContext$.withBlockContext(BlockContext.scala:85) at akka.dispatch.BatchingExecutor$BlockableBatch.run(BatchingExecutor.scala:93) at akka.dispatch.TaskInvocation.run(AbstractDispatcher.scala:48) at akka.dispatch.ForkJoinExecutorConfigurator$AkkaForkJoinTask.exec(ForkJoinExecutorConfigurator.scala:48) at java.base/java.util.concurrent.ForkJoinTask.doExec(ForkJoinTask.java:290) at java.base/java.util.concurrent.ForkJoinPool$WorkQueue.topLevelExec(ForkJoinPool.java:1020) at java.base/java.util.concurrent.ForkJoinPool.scan(ForkJoinPool.java:1656) at java.base/java.util.concurrent.ForkJoinPool.runWorker(ForkJoinPool.java:1594) at java.base/java.util.concurrent.ForkJoinWorkerThread.run(ForkJoinWorkerThread.java:183) Caused by: com.exalate.api.exception.script.ScriptException: startup failed: Script55.groovy: 22: unexpected token: 360005568420 @ line 22, column 48. tToRightUrgency["IL ZD".issue.3600055684 ^ 1 error at com.exalate.error.services.ScriptExceptionCategoryService.categorizeProcessorAndIssueTrackerExceptionsIntoScriptExceptions(ScriptExceptionCategoryService.scala:42) at com.exalate.processor.ExalateProcessor.executeProcessor(ExalateProcessor.java:57) at com.exalate.replication.services.replication.mapping.MappingService.$anonfun$executeInScriptRule$1(MappingService.scala:272) at scala.util.Try$.apply(Try.scala:213) at com.exalate.replication.services.replication.mapping.MappingService.executeInScriptRule(MappingService.scala:269) ... 16 more Caused by: javax.script.ScriptException: org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: Script55.groovy: 22: unexpected token: 360005568420 @ line 22, column 48. tToRightUrgency["IL ZD".issue.3600055684 ^ 1 error at org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(GroovyScriptEngineImpl.java:158) at java.scripting/javax.script.AbstractScriptEngine.eval(AbstractScriptEngine.java:264) at com.exalate.processor.ExalateProcessor.execute(ExalateProcessor.java:98) at com.exalate.processor.ExalateProcessor.executeProcessor(ExalateProcessor.java:55) ... 19 more Caused by: org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: Script55.groovy: 22: unexpected token: 360005568420 @ line 22, column 48. tToRightUrgency["IL ZD".issue.3600055684 ^ 1 error at org.codehaus.groovy.control.ErrorCollector.failIfErrors(ErrorCollector.java:311) at org.codehaus.groovy.control.ErrorCollector.addFatalError(ErrorCollector.java:151) at org.codehaus.groovy.control.ErrorCollector.addError(ErrorCollector.java:121) at org.codehaus.groovy.control.ErrorCollector.addError(ErrorCollector.java:133) at org.codehaus.groovy.control.SourceUnit.addError(SourceUnit.java:325) at org.codehaus.groovy.antlr.AntlrParserPlugin.transformCSTIntoAST(AntlrParserPlugin.java:224) at org.codehaus.groovy.antlr.AntlrParserPlugin.parseCST(AntlrParserPlugin.java:192) at org.codehaus.groovy.control.SourceUnit.parse(SourceUnit.java:226) at org.codehaus.groovy.control.CompilationUnit$1.call(CompilationUnit.java:201) at org.codehaus.groovy.control.CompilationUnit.applyToSourceUnits(CompilationUnit.java:965) at org.codehaus.groovy.control.CompilationUnit.doPhaseOperation(CompilationUnit.java:642) at org.codehaus.groovy.control.CompilationUnit.processPhaseOperations(CompilationUnit.java:618) at org.codehaus.groovy.control.CompilationUnit.compile(CompilationUnit.java:595) at groovy.lang.GroovyClassLoader.doParseClass(GroovyClassLoader.java:401) at groovy.lang.GroovyClassLoader.access$300(GroovyClassLoader.java:89) at groovy.lang.GroovyClassLoader$5.provide(GroovyClassLoader.java:341) at groovy.lang.GroovyClassLoader$5.provide(GroovyClassLoader.java:338) at org.codehaus.groovy.runtime.memoize.ConcurrentCommonCache.getAndPut(ConcurrentCommonCache.java:147) at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:336) at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:320) at groovy.lang.GroovyClassLoader.parseClass(GroovyClassLoader.java:262) at org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.getScriptClass(GroovyScriptEngineImpl.java:331) at org.codehaus.groovy.jsr223.GroovyScriptEngineImpl.eval(GroovyScriptEngineImpl.java:153) ... 22 more

      CommentAdd your comment...