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

setFormValue() doesnt work on cascade select in JSD

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Done
    • Priority: Trivial
    • Resolution: Done
    • Affects Version/s: 5.4.49
    • Fix Version/s: 5.5.2
    • Component/s: Behaviours
    • Labels:
      None
    • Sprint:
      Sprint 49, Sprint 50
    • Critical Points:
      1.8

      Description

      The field appears unchanged. The script used is below.

      import com.atlassian.jira.component.ComponentAccessor
      
      def fieldName = "CascadeList"
      
      def field = getFieldByName(fieldName)
      def optionsManager = ComponentAccessor.getOptionsManager()
      
      def customField = ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName(fieldName)
      def fieldConfig = customField.getRelevantConfig(getIssueContext())
      
      def options = optionsManager.getOptions(fieldConfig)
      def parentOption = options.find {it.value == "parent"}
      def childOption = parentOption?.childOptions?.find {it.value == "child"}
      
      field.setFormValue([parentOption.optionId, childOption.optionId])
      

        Attachments

          Activity

            People

            Assignee:
            rholban Roland Holban [X] (Inactive)
            Reporter:
            rholban Roland Holban [X] (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved: