Could not find class

Hi Jamie,

I have written a groovy listener and trying to add it as Script Listener. I already have my .groovy file in attlasian-jira/WEB-INF/classes/com/nju/jira/listeners - according to package defined in groovy file.

I've read all discusion bellow the Listeners article here

and it seems my problem is different from others. First I've tried to write my class directly to the class name field, then i tried to write com.onresolve.jira.groovy.listener.GroovyListener in and then com.onresolve.jira.groovy.listener.ExampleListener as you suggest as a first attempt. All results in the same 

Could not find class, check it is under a 'scripts directory': java.lang.ClassNotFoundException: com.onresolve.jira.groovy.listeners.ExampleListener

I have no idea what 'script directory' is. I ve searched all JIRA directory and there is no Scripts directory. 

Thanx much, Tom

here is the snippet of my class 

package com.nju.jira.listeners

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 CommentCopyListener extends AbstractIssueEventListener {
	Category log = Category.getInstance(CommentCopyListener.class)
    void workflowEvent(IssueEvent event) {
		//my functionality here


2 answers

1 accepted

Hi there,

I solved this. Problem was that I copied my .groovy file to WEB-INF/classes (according to 3 years old article)

In nowadays version of Script Runner, the script has to be in /var/atlassian/application-data/jira/scripts + package folders. 

Now it works, I have my Listener running.

As a side note here, if you don't know what directory to put your scripts, just look at the script console screen and it tells you exactly where it is expecting the script.

Suggest an answer

Log in or Join to answer
Community showcase
Sarah Schuster
Posted Jan 29, 2018 in Jira

What are common themes you've seen across successful & failed Jira Software implementations?

Hey everyone! My name is Sarah Schuster, and I'm a Customer Success Manager in Atlassian specializing in Jira Software Cloud. Over the next few weeks I will be posting discussion topics (8 total) to ...

2,897 views 12 18
Join discussion

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
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot