Script Listener not working

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
Accepted answer

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
Community showcase
Published Oct 31, 2018 in Marketplace Apps

Marketplace Spotlight: Zephyr

Hello Atlassian Community! Each month, we run a series of Spotlights to highlight Marketplace vendors and apps that our team thinks this Community would find valuable. In last month's Spotlig...

412 views 0 3
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you