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

Dynamic forms parameters with multiple values do not work correctly in Behaviour scripts

    XMLWordPrintableJSON

Details

    • Bug
    • Status: To Do
    • High
    • Resolution: Unresolved
    • 7.3.0
    • None
    • Behaviours, Dynamic Forms
    • 2.3

    Description

      Using the @GroupPicker annotation with the "multiple" option set to true returns a list of null values.

      Note: This bug is specific to Behaviours and parameters with multiple values - the script below will work in all other contexts (assuming you don't use Behaviour specific methods like getFieldById() or setFormValue()).

      Steps to Reproduce

      • Create a new Behaviour Initialiser script using the sample code below:
        import com.atlassian.crowd.embedded.api.Group
        import com.onresolve.scriptrunner.parameters.annotation.GroupPicker
        
        @GroupPicker(label = 'Sample Group', description = '', multiple = true)
        List<Group> groups
        getFieldById("summary").setFormValue(groups.toString())
        
      • Once the method is added to the initialiser, a picker should appear as shown in the image below:-
      • Save the Behaviour
      • Create a new Issue for the project that the Behaviour has been mapped to. 

      Expected Behaviour

      The groups that have been selected from the picker should be displayed in the Summary field.

      Actual Behaviour

      Selecting a group when configuring the Behaviour will result in the Summary field being set to something like: [null, null, null, null, null, null, null, null, null] when the Behaviour runs on an issue:

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              rkumar Ram Kumar Aravindakshan
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated: