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

StackOverflowError when getValue() of a Script Field from a Script Field in Preview

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Done
    • Low
    • Resolution: Duplicate
    • 7.8.0, 7.11.0, 7.12.0
    • None
    • Script Fields
    • None
    • 0

    Description

      Let's say we have Script Field A and B. Getting the value of a Script Field B from Script Field A works fine. Preview Script Field A works the first time, but when trying to preview Script Field A for the second time onwards, it loops and throws StackOverflowError.

      Able to reproduce in:

      Jira Version ScriptRunner Version Able to Reproduce
      8.22.6 7.12.0 yes
      9.4.2 7.12.0 yes
      9.6.0 7.12.0 yes

      Steps to Reproduce

      1. Create two Script Fields:
        Script Field A:
        import com.atlassian.jira.component.ComponentAccessor
        
        def scriptField = ComponentAccessor.customFieldManager.getCustomFieldObjectsByName('case-29165-24201field').first()
        def scriptFieldValue = issue.getCustomFieldValue(scriptField) as String
        
        if(scriptFieldValue){
             scriptFieldValue
        }
        

        Script Field B:

        return "some text"
        
      1. On Script Field A configuration screen, type any issue that has both script fields, click "Preview".
      2. Click preview again.

      Expected Behaviour

      It should be working just like the first click of "Preview".

      Actual Behaviour

      It loops and crashes on StackOverFlow Exception.

      Additional Info

      Jira 8.22.6 + ScriptRunner 7.12.0 jira8.22.6_sr7.12.0.mov
      Jira 9.4.2 + ScriptRunner 7.12.0 jira9.4.2_sr7.12.0.mp4
      Jira 9.6.0 + ScriptRunner 7.12.0 jira9.6.0_sr7.12.0.mov

      Attachments

        1. jira8.22.6_sr7.12.0.mov
          199.55 MB
        2. jira9.4.2_sr7.12.0.mp4
          179.20 MB
        3. jira9.6.0_sr7.12.0.mov
          196.10 MB
        4. stacktrace.log
          84 kB

        Issue Links

          Activity

            People

              Unassigned Unassigned
              tse Tim Se
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: