Dear all,
I am using successfully the ScriptRunner with Groovy scripts for
postconditions etc.
Now I would like to make a library of functions in groovy and put it
into a class, so that is methods are called by different script as
post functions for different transitions.
I am knowledgeable enough of Java's package/import/classpath
philosophy, but I do not know how this translates in the JIRA
standalone/Script Runner set-up.
I have the following files:
TestGroovy.groovy
// start code snippet
package sed.jira;
import com.atlassian.jira.ComponentManager
import java.util.HashMap
import com.atlassian.jira.issue.CustomFieldManager
import com.atlassian.jira.issue.Issue
import com.atlassian.jira.issue.MutableIssue
import com.atlassian.jira.issue.comments.CommentManager
...
import com.atlassian.jira.event.type.EventDispatchOption
import sed.jira.JiraLibrary;
JiraLibrary jl = new JiraLibrary();
def Category log = Category.getInstance("com.onresolve.jira.groovy.PostFunction"
);
log.setLevel(org.apache.log4j.Level.DEBUG);
// end code snippet
and a simple:
// start code snippet
package sed.jira;
class JiraLibrary {
String myMethod(String pippo) {
return pippo+ ":" + pippo;
}
}
// end code snippet
I would like TestGroovy.groovy to be called by the ScriptRunner
but it fails with:
unable to resolve class sed.jira.JiraLibrary @ line 24, column 1
I guess my question boils down to:
a) do I need somehow to compile (I do not have a groovy compiler on my
Jira box) the code and package it in a jarfile or similar?
b) what would I put the scripts or the compiled versions thereof?
What's ScriptRunner (or JIRA's ) CLASSPATH?
Thanks
Michele