Uploaded image for project: 'SR for Jira - Development'
  1. SR for Jira - Development
  2. SRJIRA-4237

Script changes are no longer triggering a recompile of scripts stored in script roots/created with script editor

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Done
    • Priority: High
    • Resolution: Won't Fix
    • Affects Version/s: 5.7.1.1-p5
    • Fix Version/s: None
    • Labels:
    • Sprint:
      SR4J Sprint 90
    • Critical Points:
      9.6

      Description

      Changes to scripts in the script roots do not appear to be triggering a re-compile of the script.

      Steps to reproduce:

      1. Create a Script file named "AScriptFile.groovy" in the script editor under a new folder named "myFolder"
      2. Add a basic method:
        package myFolder
        
        import org.apache.log4j.Level
        import org.apache.log4j.Logger
        
        static void aMethod(String test){
        
            def log = Logger.getLogger("My Method")
            log.setLevel(Level.ERROR)
            
            log.error("""
            ----------
            ??????????
        	$test
            ----------
            
            """)
        }
        
      1. Run the above in the script console like this
        String myString = "Hello"
        
        myFolder.AScriptFile.aMethod(myString)
        
      1. You should see the correct log output
      2. Now change the log string by removing the question marks and click the save button in the script editor to save the changes
      3. Go back to the Script Console and run the script again. It will still run the old method with the old log statement
      4. 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-5.7.1.1-p5.mp4

      Workaround

      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 

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              twozniak Tomasz Wozniak
              Reporter:
              mclark Matthew Clark
              Votes:
              1 Vote for this issue
              Watchers:
              17 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: