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

Running same script in Console doesn't immediately reflect new script changes in Script Editor

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Done
    • Priority: Low
    • Resolution: Duplicate
    • Affects Version/s: 6.16.0
    • Fix Version/s: None
    • Labels:
      None
    • Critical Points:
      0.6

      Description

      Step to Reproduce
      1. Write a simple script, Utility class, in Script Editor:

      import com.atlassian.jira.component.ComponentAccessor
      
      class Utility extends ComponentAccessor {
          static int count = 0
          
          static String test1() {
              count++
              return 'Test Success ' + count
          }
      }
      

      2. Write and run following script in Console:

      import Utility
      
      log.warn Utility.test1()
      log.warn Utility.getIssueManager()
      

      3. Make changes to Utility class in Script Editor:
          a. Remove extends ComponentAccessor
          b. Change test1() to test2()

      import com.atlassian.jira.component.ComponentAccessor
      
      class Utility {
          static int count = 0
          
          static String test2() {
              count++
              return 'Test Success ' + count
          }
      }
      

      4. Run the same code in Console.

      Expected Results
      1. test1() is not accessible and display an error message.
      2. getIssueManager() is not accessible and display an error message.

      Actual Result
      1. test1() can still be run and count is still incremented.
      2. getIssueManager() can still be run.

      Workaround
      1. Make any code changes (like adding log.warn) to script in Console. Then, SR will compile new 'environment' with expect result.
      2. Enable and disable ScriptRunner also works.

      I have attached a screen recording for this bug.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              Unassigned Unassigned
              Reporter:
              mlim Max Lim
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: