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

Behaviour is unable to read the Child List's value from Cascading Select Field

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Done
    • Major
    • Resolution: Duplicate
    • 6.58.0
    • None
    • Behaviours
    • None
    • 0

    Description

      When using the Behaviour to validate the Parent and Child values from the Cascading Select Field, the Child values are not detected. This was working fine until version 6.57.0

      Steps to Reproduce

      1. Add a new Behaviour configuration with two Server-Side Behaviours. The first for a Cascading Select Field and the second for a Text Field
      2. For the Cascading Select Field, below is the sample code used:-
        import com.onresolve.jira.groovy.user.FieldBehaviours
        import groovy.transform.BaseScript
        
        @BaseScript FieldBehaviours behaviours
        def cascadeField = getFieldById(fieldChanged)
        def cascadeFieldValue = cascadeField.value as List
        
        def sampleText = getFieldByName('Sample Text Field')
        cascadeField.clearError()
        
        if(cascadeFieldValue) {
            if(cascadeFieldValue.size() == 2) {
                log.warn "====>>>>${cascadeFieldValue.first()}  ${cascadeFieldValue.last()}"
                sampleText.setFormValue(cascadeFieldValue.last().toString())
                sampleText.hidden = false
            } else {
                cascadeField.error  = "Child value cannot be null"
            }
        }
        

        Also, a field error message is included for the Cascading Select List to ensure that both parent and child options are selected.
        Below is a screenshot of the Server-Side Behaviour configuration for the Cascading Select List:-

      3. And for the Text Field, just use the toggle to update the Shown option to Hidden as shown below:-
      4. Try to create a new issue and select an option from both the parent and child of the Cascading Select List.

      Expected Behaviour

      The text field is made visible and is updated with the option selected from the child list of Cascading Select List.

      Actual Behaviour

      The Behaviour doesn't get triggered. Even if the Child option is selected from the Cascading Select List, the error message does not get removed.

      Additional Info

      • A test video, i.e. test1.mp4,┬áthat displays the test run on ScriptRunner version 6.57.0 and 6.58.0, is included to show the difference in the Behaviour.

      Attachments

        1. behaviour_config1.png
          behaviour_config1.png
          117 kB
        2. behaviour_config2.png
          behaviour_config2.png
          43 kB
        3. test1.mp4
          13.90 MB

        Issue Links

          Activity

            People

              Unassigned Unassigned
              rkumar Ram Kumar Aravindakshan
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: