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

This widget could not be displayed.

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 Aug 22, 2018 in Marketplace Apps

How a Marketplace app tech team is achieving gender diversity

Hello! My name is Genevieve Blanch, and I'm the Marketing Manager at RefinedWiki, creators of apps to give teams the tools to customize Atlassian platforms. Currently, 44% of the tech team at Re...

514 views 3 18
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