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

Behaviours setRequired method on User Picker field can prevent the user selection drop down clearing

    Details

    • Type: Bug
    • Status: Done (View Workflow)
    • Priority: High
    • Resolution: Done
    • Affects Version/s: 5.6.8.1-jira8
    • Fix Version/s: 6.2.0
    • Component/s: Behaviours
    • Labels:
      None
    • Sprint:
      SR4J Sprint 79
    • Critical Points:
      0.4

      Description

      If you have a behaviour that sets a User picker to required after a change is made to the field (i.e. a field server-side script) the drop-down section that shows a user name which matches the text you enter never gets removed from view when you select a user.

      The action of setting required after triggering the user interaction event on the field seems to trigger another user action event which then causes the suggested user dropdown to re-appear.

      See video here BehavioursBug.mp4

      Steps to reproduce:

      1. Create a User Picker field (Jira field)
      2. Add a behaviour to that field. Like this:
        String destinationStepName = getDestinationStepName();
        String statusName;
        
        def field = getFieldById(getFieldChanged())
        
        if (destinationStepName != null) {
            statusName = destinationStepName;
        } else {
            statusName = underlyingIssue.getStatus().getName();
        }
        
        def statusList = ["Done", "In Progess"]
        
        if(statusList.contains(statusName)){
            
            def  value = field.getValue()
            
            field.setRequired(true)
        
         if(! value){
            
            log.error("no value selected")
            
         }else{
            
             log.error("A value has been selected")  
         }
            
        }else{
           field.setRequired(false)
        }
        
      3. set a transition screen on the Done transition
      4. Attempt to select a user with the behaviour active and the dropdown selection box should never disappear.

       

      Workaround is to set required in the initialiser instead of the server side script on the field

        Attachments

          Structure

            Activity

              People

              Assignee:
              jechlin Jamie Echlin
              Reporter:
              mclark Matthew Clark
              Votes:
              2 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Structure Helper Panel