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

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: To Do
    • Priority: High
    • Resolution: Unresolved
    • Affects Version/s: 5.6.11, 6.39.0
    • Fix Version/s: None
    • Component/s: script plugins
    • Labels:
    • Critical Points:
      0.7

      Description

      Summary

      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 .)

      Note:

      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

      Workaround

      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.

        

       

        Attachments

          Activity

            People

            Assignee:
            Unassigned Unassigned
            Reporter:
            mclark Matthew Clark
            Votes:
            3 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated: