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

2 votes
Henning Tietgens Community Champion Sep 25, 2012

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

Henning Tietgens Community Champion Sep 25, 2012

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 ...

Henning Tietgens Community Champion Sep 25, 2012

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.

Henning Tietgens Community Champion Sep 26, 2012

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

Henning Tietgens Community Champion Apr 06, 2015

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
Posted Sep 25, 2018 in Jira

Atlassian Research Workshop opportunity on Sep. 28th in Austin, TX

We're looking for participants for a workshop at Atlassian! We need Jira admins who have interesting custom workflows, issue views, or boards. Think you have a story to sha...

456 views 7 5
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