Hello, I'm using Insight version 5.6.2 and Jira.
I'm experiencing different behaviours when running groovy code inside "Insight Script Console" which I can reach by going in "Apps" >>"Insight">>"Insight Script Console" and when running the same groovy code inside "Insight Groovy Script" which I can reach by clicking "Edit Workflow" >> transition properties >> "postfunctions" >> "Insight Groovy Script" in Jira.
For instance the following SSCCE (short, self contained, correct example) code:
package myapp
import org.apache.log4j.Level
import org.apache.log4j.Logger
public class MySuperApp
{
Logger log
MySuperApp() {
log = Logger.getLogger("net.MySuperApp")
log.setLevel(Level.DEBUG)
}
public void funx(String myParam) {
log.debug("running fun: ${myParam}")
}
}
MySuperApp app = new MySuperApp()
app.funx("hello")
returns an error in Insight Groovy script only:
Caught exception while attempting to perform action 11 from workflow 12009 on issue 'SU-762'
com.opensymphony.module.propertyset.PropertyImplementationException: Property 'myParam' not found
the reason is that ${myParam} somehow is not understood as correct syntax but I should instead opt for String concatenation, for instance:
log.debug("running fun: "+myParam)
The questions are:
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.