Issues with scriprunner are moving to 7.x

Since moving to JIRA 7.x I've a problem with calling classes from groovy scripts.

I've put my class on the default location:

D:\Program Files\Atlassian\Application Data\JIRA\scripts

Content of the file:

==============

package CegekaGroovy

/**
* Created by R.Koppelaar on 15-2-2016.
*/
class TestClass
{
public static String Hello()
{
return "Aangeroepen";
}
}

 

And try to import it from the script console within jira:

import CegekaGroovy.TestClass

 

The red cross disappear, but when running the script following error occurs:

org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed: Script147.groovy: 1: unable to resolve class CegekaGroovy.TestClass @ line 1, column 1. import CegekaGroovy.TestClass ^ 1 error


Where should we place the classes. In JIRA 5.x we placed the files in following location:

D:\Program Files\Atlassian\JIRA\atlassian-jira\WEB-INF\classes\CegekaGroovy

which seems to work perfectly

 

 

2 answers

Hi Ron,

In JIRA 7 the  default classes directory would be located in the JIRA install directory at <JIRA-INSTALL>/atlassian-jira/WEB-INF/classes.

In JIRA 7 the scripts directory where you can call scripts from a file is in the JIRA home directory at  <JIRA-Home>/scripts

Can you please confirm if the relevant scripts and class files are present inside these locations.

Thanks

Kristian

I've put both my classes and my scripts in the JIRA HOME Directory. This results in a working way for calling classes within my scripts. So directory structur eis:

<JIRA_HOME>/scripts

Within this folder a sub-folder is created: CegekaGroovy which contains the classes.

Using classes within the scripts is okay.

Using classes from the script console will fail

Any reason for that?

Hi Ron,

The scripts should fire from the script console.

Could you please raise a ticket at https://productsupport.adaptavist.com/servicedesk/customer/portal/2 outlining the details above along with your version of Script Runner and JIRA 7 so that we can investigate this further.

Many Thanks

Kristian

Suggest an answer

Log in or Sign up to answer
Atlassian Community Anniversary

Happy Anniversary, Atlassian Community!

This community is celebrating its one-year anniversary and Atlassian co-founder Mike Cannon-Brookes has all the feels.

Read more
Community showcase
Bridget Sauer
Published Thursday in Marketplace Apps

Calling all developers––You're invited to Atlas Camp 2018

 Atlas Camp   is our developer event which will take place in Barcelona, Spain  from the 6th -7th of   September . This is a great opportunity to meet other developers and get n...

364 views 0 6
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