Changes to scripts in the script roots do not appear to be triggering a re-compile of the script.
Steps to reproduce:
- Create a Script file named "AScriptFile.groovy" in the script editor under a new folder named "myFolder"
- Add a basic method:
- Run the above in the script console like this
- You should see the correct log output
- Now change the log string by removing the question marks and click the save button in the script editor to save the changes
- Go back to the Script Console and run the script again. It will still run the old method with the old log statement
- If you run the "Clear Groovy classloader or Jira internal caches" built-in script to clear the groovy class loader it fixes the problem, but this should not be required. We should auto-detect the change on the next run of the script
This video shows the issue as well: ChangesToScriptsDoNotTriggerRecompileOfScriptsInSR-188.8.131.52-p5.mp4
As the potential fix for this issue has high complexity which could introduce new bugs, we are closing this issue with `Won't Fix` and are suggesting use of two workarounds:
1. Add white spaces to all dependent scripts
2. Use "Clear Groovy classloader or Jira internal caches" to clear Groovy classloader