JIRA ScriptRunner: Any way to support script search autocomplete in prod

fecktty2013 December 21, 2020

I know that we can customize the plugin.script.roots variable to support the autocomplete script search. This is also mentioned in the docs here:

https://scriptrunner.adaptavist.com/6.16.0/jira/#_script_root_search

I can use the below configuration to change that script root

// under build/plugins/plugin[jira-maven-plugin]/configuration
<systemPropertyVariables> <plugin.script.roots>${project.basedir}/src/main/groovy</plugin.script.roots></systemPropertyVariables>

However, this seems to only work in local dev environment. 

When the plugin gets build into a jar package and uploaded into an online environment. The above config doesn't work.  

I understand I can change the JVM argument to support that, but, by all means, in the prod, all the groovy classes and scripts are inside the jar package. 

 

So my questions is, is it possible to support the script root search autocomplete to use all scripts inside my plugin?  

1 answer

0 votes
Italo Qualisoni [e-Core]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 21, 2020

@fecktty2013 ,

The fact that this works in Dev is great! I think you should look for potential differences between Dev and Production. My suggestion is to start by these questions:

1 - Do you have the same version of Scriptrunner in both Dev and Production?

2 - Do you have the same JIRA version in both Dev and Production?

3- I would also compare Dev and Production JVM arguments to check potential differences. Did you have to set  -Dplugin.script.roots in Dev to make it work?

fecktty2013 December 21, 2020

Thanks for your suggestions. 

1. Yes, 2. Yes.  3. Yes I have to set  -Dplugin.script.roots  in Dev to make it work. 

Then questions become

 1- What path can I set it to? 

 2- The path like  `${project.basedir}/src/main/groovy` is probably for local dev environment. In Prod there is no path and source scripts like this. In prod there is only jar package under $JIRA_HOME/plugins/ folder. How to make the scripts to be discovered just like the scripts under script root ( $JIRA_HOME/scripts/ ) folder to be searched. 

Italo Qualisoni [e-Core]
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
December 21, 2020

Right, what value are you using in Dev for -Dplugin.script.roots ?

I have a feeling that Scriprunner use the <plugin.script.roots> directive in your pom.xml and combine your value with the current path in runtime (when you enable/install your app).

I think in production your -Dplugin.script.roots should be $JIRA_HOME/scripts (usually this is the default, it's important to check if the user that is running JIRA has read/write access to this folder).

You can test in Dev with -Dplugin.script.roots equals $JIRA_HOME/scripts and restart the application to see if the autocomplete works as expected. Also you can comment the -Dplugin.script.roots in Dev to see if you have the same Prod behavior with no autocomplete and if that happens you can confirm that -Dplugin.script.roots is required to make it work.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
FREE
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events