Uploaded image for project: 'SR Platform'
  1. SR Platform
  2. SRPLAT-2284

When creating a custom field or listener, groovy files from a previously installed script plugin .jar file are inaccessible



    • Bug
    • Status: To Do
    • Medium
    • Resolution: Unresolved
    • 7.13.0
    • None
    • Script Plugins
    • SR4J Sprint 148 (8.4.0), SR4J Sprint 149 (8.5.0), SR4J Sprint 150 (8.6.0), SR4J Sprint 151 (8.7.0)
    • 0



      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.

      Steps to reproduce

      1. Clone the samples repository
      2. Open it up in IntelliJ
      3. 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`
      4. Compile the custom plugin. e.g: run `atlas-package`
      5. 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.
      6. Go to Fields-> Create Script Field -> Custom Script Field and try to auto-complete the file path by typing com
      7. 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.

      Expected result:

      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.

      Actual result:

      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"


        Issue Links



              Unassigned Unassigned
              jrockemann Jan Rockemann
              1 Vote for this issue
              3 Start watching this issue