Groovy Custom Listener gets error: Cannot open URL: bundle://186.0:0/null

Hello there,

I've been trying to find a solution on this one for hours but I'm stuck. So I think it's time I ask for help! I tried to find information and I did a lot of google search but I couldn't figure it out.

So, here is what I'm trying to achieve:
I'm setting up a HelpDesk environnement using a combination of JIRA, JEMH, Automation Plugin, Script Runner plugin (Jira Service Desk doesn't suit our needs for a couple of important reasons). Now, I would like HelpDesk people to be able to send emails to customers when they add a comment to an issue. Which I managed to do. But what I want, is to send an email only when the comment's visibility is set to a specific role.
JEMH allows us to do the opposite. I can set it so that all comment's visibility roles fire an email sending but a specific role.

So I'm trying to find a workaround. I want to create a Custom Script Listener based on a groovy class that listens to the "Issue Commented" event. The listener checks if the comment's visibility is supposed to fire an email to the user or not. If so, it fires a custom event that the JEMH plugin listens to. Then the JEMH plugin sends the correct email when this custom event is fired.
I cannot do this with the built in listener "Fires an event when condition is true" nor with the Automation Plugin because I need to forward the comment attached to the "Issue Commented" event to my Custom Event so that JEMH can send it to the customer.

The issue:
So I wrote a groovy class, I put it on the JIRA server but when I create the Custom Script Listener in JIRA GUI, I get the error message :
"Problem loading class/script: groovy.util.ResourceException: Cannot open URL: bundle://186.0:0/null"

Relevant information:

The groovy class is

package megalis

import com.atlassian.jira.event.issue.AbstractIssueEventListener
import com.atlassian.jira.event.issue.IssueEvent
import com.atlassian.jira.event.issue.IssueEventManager
import com.atlassian.jira.event.type.EventType
import groovy.util.logging.Log4j
import org.apache.log4j.Level

public class FireEnvoyerMailUsager extends AbstractIssueEventListener{

    void workflowEvent(IssueEvent event) {


        if (event.eventTypeId == EventType.ISSUE_COMMENTED_ID && event.getComment()) {
            def issue = event.issue
        def comment = event.getComment()
        if (comment.getRoleLevelId() == (long)10201 ){
            IssueEventManager.dispatchEvent((long)10004, issue, event.getUser(), event.getComment(), null, null)
                log.debug("Evenement Commentaire externe declenche avec pour commentaire: ${event.getComment()}")

I put this class on the server under /opt/atlassian/jira/atlassian-jira/WEB-INF/classes/megalis/FireEnvoyerMailUsager.groovy

In the Custom Listener screen, in the "Name of groovy class" field, I set : megalis.FireEnvoyerMailUsager

I'm not sure but could it possibly be related to or my version of the Atlassian Universal Plugin Manager ?

Our environnement:
JIRA - v6.3.13 (standalone)
Adaptavist Script Runner - 3.1.3
JEMH - 1.6.71
Atlassian Universal Plugin Manager - 2.18.4

I hope I'm not asking a question that has already been solved many times, but I really couldn't find the solution until now.



3 answers

1 accepted

You should put it under <jira.home>/scripts, in your megalis directory, not in the installation directory.

I was under the impression that SD comments didn't use the role level, although I haven't had time to check that out, and it seems a bit unlikely anyway.

So I'm re-reading this post : I'm wondering if the "null" part could come from a plugin.script.roots variable that wouldn't be set at all. I'm gooing to check that.

Thanks you! I wasn't aware that jira_home was different from jira_install. Now my class is loaded and I can debug it to make it work.

Indeed, I don't think SD uses the role level. But we don't use SD at all because of some of it's limitations (mainly,

sorry, I ignored the bit where you said you *weren't* using JSD.

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Jan 08, 2019 in Jira

How to Jira for designers

I’m a designer on the Jira team. For a long time, I’ve fielded questions from other designers about how they should be using Jira Software with their design team. I’ve also heard feedback from other ...

1,084 views 4 9
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