Script Listener not working

Dieter Scheruga March 20, 2015

I'm trying to setup a simple Script Listner but I always get

Problem loading class: groovy.lang.MissingMethodException: No signature of method: static groovy.lang.Category.getInstance() is applicable for argument types: (java.lang.Class) values: [class softsolution.OrgGroupListener]

I found this thread where it seems to work:  https://answers.atlassian.com/questions/12917257 .

I put my OrgGroupListener.groovy file under

/var/atlassian/application-data/jira/scripts/softsolution

Name of groovy class: softsolution.OrgGroupListener

Also if i remove Category in the script i sill the the above error

 

Here is my listener

 

package softsolution

 

import com.atlassian.jira.ComponentManager

import com.atlassian.jira.issue.comments.CommentManager

import com.atlassian.jira.issue.comments.Comment

import com.atlassian.jira.issue.Issue

import com.atlassian.jira.issue.MutableIssue

import com.atlassian.jira.issue.IssueManager

import org.apache.log4j.Category

 

public class OrgGroupListener extends AbstractIssueEventListener {

    Category log = Category.getInstance(OrgGroupListener.class)

    

    @Override

    void workflowEvent(IssueEvent event) {

 

        //my functionality here

 

    }

}

 

 

 

 

1 answer

1 accepted

0 votes
Answer accepted
Dieter Scheruga March 20, 2015

I've updated scirpt runner to newest version and restarted JIRA => now it works.

BTW I had to update my simple listener (see below).

 

package softsolution;

 

import com.atlassian.jira.event.issue.*;

import org.apache.log4j.Category;

 

public class OrgGroupListener extends AbstractIssueEventListener {

    Category log = Category.getInstance(OrgGroupListener.class)

    

    @Override

    void workflowEvent(IssueEvent event) {

        log.setLevel(org.apache.log4j.Level.DEBUG);

        log.debug ("SGD Event: ${event.getEventTypeId()} fired for ${event.issue} and caught by ExampleListener");

        //my functionality here

 

    }

}

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events