We have a simple groovy script in our Listeners list that *was* working up until recently. Not sure if anything changed on the Jira server (still looking/working with admins), but we now get this error:
groovy.lang.MissingMethodException: No signature of method: UpdateField.main() is applicable for argument types: ([Ljava.lang.String;) values: [[]] Possible solutions: wait(), wait(long), any(), find(), wait(long, int), init(java.util.Map) at com.onresolve.scriptrunner.runner.RunScriptInvoker$run.call(Unknown Source) at com.onresolve.scriptrunner.runner.AbstractScriptRunner.runScript(AbstractScriptRunner.groovy:170) at com.onresolve.scriptrunner.runner.AbstractScriptRunner$runScript$6.callCurrent(Unknown Source)
The script:
import com.atlassian.jira.event.issue.AbstractIssueEventListener
import org.apache.log4j.Logger
import com.atlassian.jira.event.issue.IssueEvent
import com.atlassian.jira.issue.Issue
class UpdateField extends AbstractIssueEventListener {
Logger log = Logger.getLogger(UpdateField.class)
'@Overrde
void workflowEvent(IssueEvent event) {
log.setLevel(org.apache.log4j.Level.DEBUG)
Issue issue = event.issue
def key = issue.getKey()
def cmd = ["/bin/script.bash", key]
cmd.execute()
}
}
The groovy script is being called in the Listener list as
/opt/atlassian/jira/atlassian-jira/WEB-INF/classes/com/test/updateIssue.groovy
We're using Jira Server v8.1.0 and ScriptRunner v5.6.15.1-p5.
The ScriptRunner docs say the Heritage Custom Listeners are still valid, so not sure what's going on.
Any ideas? Thanks!
I converted the class to a goovy script and it seems to be working now:
import com.atlassian.jira.event.issue.AbstractIssueEventListener
import com.atlassian.jira.event.issue.IssueEvent
import com.atlassian.jira.issue.Issue
Issue issue = event.issue
def key = issue.getKey()
def cmd = ["/bin/script.bash", key]
cmd.execute()
I then used the full path to the groovy script in the FILE tab.
While it was still a class, I had to package it up, then add <package>.class in the SCRIPT tab, however, the external script never got executed. Not sure if workflowEvent needed to be main or not.
Also ran into this today as well..
Jira Server v8.5.3
SR: 5.6.14.1-p5
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Apparently, there's a workaround from Adaptavist, but I haven't been able to get it working yet.
Replacing the path with the corresponding FCQN in the listener config will resolve this.
It's not clear to me where I should put the FQCN; I've tried the file path and script entries, but have been unsuccessful so far.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @Jason MacDonald ,
What is this groovy script supposed to do?
I can see that there is a bash script that will be executed in the server what does it do?
Any background on the requirements? I can possibly suggest alternatives but I just don't understand the use case.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi @brbojorque ,
It just calls that bash script to do some restapi calls on another (non-Atlassian) tool. Definitely a hack to accomplish calling that pre-existing script. The bash script gets the issue key as its only argument, and the script does the rest from there.
Thanks!
-Jason
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.