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

Samples-plugin manual jar install does not autocomplete paths for scripts stored inside the plugin jar



    • Bug
    • Status: To Do
    • High
    • Resolution: Unresolved
    • 5.6.11, 6.39.0
    • None
    • Script Plugins
    • 3.1



      When you install the resulting custom plugin jar after you have finished making your custom script plugin the auto-completion does not show for the scripts contained inside it, however, the scripts can still be used if you know the path to the script. (This will essentially be the package name used in the script with / instead of the .)


      If you use the jira:debug maven goal to run Jira and test your scripts, when searching for scripts in the user interface it looks like 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 script 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 the script console and try to auto-complete the file path by typing com

      Expected result:

      The path will auto-complete to show the next folder `myscripts` and then after selecting that it will show the filename of your script.

      Actual result:

      The path does not auto-complete


      Manually put the full path to the file into the script console and it should then run the script correctly. The path will be the package name but replace the `.` character with the `/` file separator.




        Issue Links



              Unassigned Unassigned
              mclark Matthew Clark
              10 Vote for this issue
              9 Start watching this issue