ScriptRunner script plugin not fully working

Soporte April 5, 2023

I would like to make a ScriptRunner script plugin for Jira, that is, a plugin that includes some scripts that I can run from ScriptRunner. I am building on the sample plugin talked about here: https://docs.adaptavist.com/sr4js/latest/best-practices/write-code/set-up-a-dev-environment

The thing is it doesn't fully work, as you can see in the following screenshot. I created a class called com.xeridia.Example that takes an org.apache.log4j.Logger and prints the current date. Technically it works, seeing as you can see the date printed on the log below, the problem is whenever I import the class or reference the file of that class, an error always shows up that the file, the package or the class doesn't exist.

Although the code is working, I need to get rid of these errors, as they more than often confuse my developers and they thing they're doing something wrong.

Is it possible?

Thanks.

scriptrunner.PNG

1 answer

0 votes
Soporte April 5, 2023

Just to muddle through, I'll answer myself. It seems like the @WithPlugin directive sort of solves the problem.

 

scriptrunner-fixed.PNG

 

However, there still seems to be a bit of a problem with ScriptRunner's script roots. It seems like it can execute the scripts correctly, but says it can't find them under the script roots:

anotherone.PNG

Also, there is no inkling whatsoever as to the script roots that were newly added by my script plugin throughout the ScriptRunner configuration.

Rafeah April 26, 2023

Hello, for the issue with ScriptRunner's roots. You might want to try to install Scriptrunner's plugin to the latest version 8.1.0. 

Suggest an answer

Log in or Sign up to answer