where to add the groovy file for a custom listener

Hi,

I've a simple question : where I have to put my groovy file to add it in the class path area of the custom listener interface ? (see the screeshot below)



Thanks.

1 answer

You have to put the file within the atlassian-jira/WEB-INF/classes/ directory of the jira installation directory, the package must match.

E.g. if your package is "bastien.listener" you have to put the groovy file to atlassian-jira/WEB-INF/classes/bastien/listener/

Henning

Maybe you can define a different directory as describe here: https://studio.plugins.atlassian.com/wiki/display/GRV/Script+Runner#ScriptRunner-Conditions%2CValidators%2CPostFunctions

But I didn't tried this until now.

Henning

Can I test my class into the script runner to verify if it works well ?
I don't wanna build the jira war every time i have to modify my class ...

Maybe you should try to install a local JIRA test instance (standalone version). There you could change the groovy file while the system is running.

I put my groovy file into /WEB-INF/classes/custom/listeners (my file is called MotherStatus.groovy), and i rebuild my war file.

Then, i tried to load it in script listener administration :


I have to build my class in a class file ? or can i keep the .groovy file ?

I think i can't resolve my problem :

I want my script executed AFTER the issue passed in the new status. Because another script is executed (somewhere else) and tests the status of this issue, and it must be in the new status.
The script in the post-function is executed before the new status ... and I don't know how to do .

In your case, the file should exist at /WEB-INF/classes/custom/listeners/MotherStatus.groovy

There are other ways of doing it too.

The class in MotherStatus.groovy which extends com.atlassian.jira.event.issue.AbstractIssueEventListener must be named "MotherStatus". You don't have to put the class file in the directory, the groovy file is enough.

Hi Henning My groovy script is importing multiple com.atlassian.jira.* classes , where should i keep this groovy script on Jira server such that it does not give missing class error. Basically my groovy is unable to resolve com.atlassian.jira classes

I suggest, you create a new question with a minimal script with imports not working and a detailed error description, including the used JIRA and SR version.

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,086 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