When you install resulting custom plugin jar after you have finished making your custom script plugin the auto-completion for custom field or listener creation does not show for the scripts contained inside it. Contrarily to SRPLAT-935 , the scripts cannot be used if you know the complete path to the script.
If you use the jira:debug maven goal to run Jira and test your scripts, when searching for scripts in the custom field or listener creation user interface it auto completes the paths to your scripts inside `/jira/src/main/resources/` (for the Jira module), however, these paths only show because you run jira:debug and they will not show when you actually install the finished plugin as a jar.
- Clone the samples repository
- Open it up in IntelliJ
- Add a custom field groovy file to /jira/src/main/resources/ inside a sub folder structure like `/jira/src/main/resources/com/myscripts/` and make sure that script uses a package of `com.myscripts`
- Compile the custom plugin. e.g: run `atlas-package`
- Take the jar that will be found in the target directory target/sr-sample-plugin-jira-1.1-SNAPSHOT.jar and upload this to an instance of Jira running ScriptRunner that is not run with jira:debug.
- Go to Fields-> Create Script Field -> Custom Script Field and try to auto-complete the file path by typing com
- Go to Fields-> Create Script Field -> Custom Script Field and try to enter the complete path to the groovy file
In this example, a custom field is chosen but it applies to listeners and potentially other SR-supported entities as well.
1) The path will auto-complete to show the next folder `myscripts` and then after selecting that it will show the filename of your script.
2) After manual entry of the complete path to the groovy file, SR should fine with script and associate it to a SR Field.
1) The path does not auto-complete
2) Field creation fails with message: "Please enter either the path to a script file or an inline script"