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

Display value of selected option in LDAP Picker Script Field

    Details

    • Type: Bug
    • Status: Done
    • Priority: Low
    • Resolution: Done
    • Affects Version/s: 6.15.0
    • Fix Version/s: 6.18.0
    • Component/s: Scripted Fields
    • Labels:
      None
    • Sprint:
      SR4J Sprint 90
    • Critical Points:
      0.7

      Description

      Summary 

      The display value of the option in a LDAP Picker Script Field when selected is different from the format that the attributes have been configured to appear via the Configuration Script.

      Steps to Reproduce the Problem

      Prerequisites

      • LDAP directory server set up with user information

      • LDAP connection set up in the Resources tab

      1. gg > input 'Script Fields' > hit enter
      2. Click on 'Create Script Field' > select 'LDAP Picker Field'
      3. Fill in the key information as shown here > click 'Add'

      Search Filter

      (objectClass=inetOrgPerson)

      Configuration Script

      import org.springframework.LdapDataEntry
      
      renderViewHtml = { String displayValue, LdapDataEntry ldapDataEntry, boolean active ->
          "${displayValue} (${ldapDataEntry.attributes.get('l').get()})"
      }
      
      renderOptionHtml = { String displayValue, LdapDataEntry row ->
          "${displayValue} (${row.attributes.get('l').get()})"
      }

      4. Click on 'Configure Screens' & select relevant screen to associate the script field with > Click 'Update'
      5. Edit an existing issue/create a new issue
      6. Click on the LDAP Picker field to expand the drop-down list. Note that the display value in the drop-down list is common name (location).
      7. Select an option from the drop-down list. Note that now the selected option is displayed just as common name, without the location.

      8. Click on 'Update'. Note that on the issue view screen, the display value is common name (location)

      Expected Behaviour

      The display value of the selected option in LDAP Picker Script Field appear consistent with the format that the attributes have been configured.

      Actual Behaviour

      The display value of the option after being selected follow the value in Display attribute field.
      For example:
      Display attribute = cn; selected option: James Bond
      Display attribute = l; selected option: Secret Location

      Additional Info

        Attachments

        1. Attribute Users.png
          Attribute Users.png
          201 kB
        2. Configuration Script Comparison.png
          Configuration Script Comparison.png
          703 kB
        3. LDAP connection.png
          LDAP connection.png
          163 kB
        4. LDAP Picker Field.png
          LDAP Picker Field.png
          230 kB
        5. Selected option display value.png
          Selected option display value.png
          590 kB

          Activity

            People

            Assignee:
            jechlin Jamie Echlin
            Reporter:
            wkoh Winnie Koh
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: