Hello All,
When I loadClass() from a script executed by a scriptrunner post function, none of the methods are available.
ie:
testMe = this.class.classLoader.loadClass( load_class, true )?.newInstance()
log.debug("testMe: " + testMe.dump())
if (!testMe.metaClass.respondsTo(testMe,"populateTransitionName")) {
log.debug("populateTransitionName is a NOT a valid method!")
}
The dump looks fine, the properties of the class are exposed and accessible ... but the test fails.
When trying to access the methods, I get a methodNotFound exception .. which I would expect since the metaClass test fails
What I really want to do is to not have to "import" a metric ton of packages so I want to accept the post function , interrogate the payload, and dynamically load the appropriate class to execute.
Maybe this is just not possible in the confines of Groovy executed by ScriptRunner?
I tried a bunch of different way to load the class including GroovyClassLoader among others.
Hopefully this is something simple? I have already wasted a couple of hour trying different ways of invoking loadClass() to try to make it work ...