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

Field Value getting disappear in edit screen

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Triage
    • Priority: Medium
    • Resolution: Unresolved
    • Affects Version/s: 5.6.1, 5.6.6
    • Fix Version/s: None
    • Labels:
      None
    • Critical Points:
      2.4

      Description

      Field Value getting disappears in edit screen given the following scenario:

      • Create a Select List Single Choice field and add "Marketing" as option
      • Create a Project Specific Multi Select Field and add "Brand Marketing" and "Central Marketing" as options
      • Create a Behaviour for those fields with the server-side script below
        import com.atlassian.jira.component.ComponentAccessor
        
        def optionsManager = ComponentAccessor.getOptionsManager()
        def customFieldManager = ComponentAccessor.getCustomFieldManager()
        
        def selectListSingleChoiceCustomField = getFieldByName("Select List Single Choice")
        def selectListSingleChoiceCustomFieldValue = selectListSingleChoiceCustomField.getValue()
        
        def selectListMultipleChoiceCustomField = getFieldByName("Project Specific Multi Select Field")
        def selectListMultipleChoiceCustomFieldValue = selectListMultipleChoiceCustomField.getValue()
        
        def selectListMultipleChoiceCustomFieldObject = customFieldManager.getCustomFieldObject(selectListMultipleChoiceCustomField.getFieldId())
        def selectListMultipleChoiceRelevantConfig = selectListMultipleChoiceCustomFieldObject.getRelevantConfig(getIssueContext())
        def selectListMultipleChoiceOptions = optionsManager.getOptions(selectListMultipleChoiceRelevantConfig)
        
        def optionsToSelect
        switch(selectListSingleChoiceCustomFieldValue) {
            case "Marketing":
                optionsToSelect = selectListMultipleChoiceOptions.findAll{ it.value in ["Brand Marketing","Central Marketing"] }
                break
        }
        if(optionsToSelect){
            selectListMultipleChoiceCustomField.setFieldOptions(optionsToSelect)
        }
        
      • Create an Issue and select the option "Marketing" in the "Select List Single Choice" field and select the options "Brand Marketing" and "Central Marketing" in the "Project Specific Multi Select" Field
      • Edit the Issue created, you'll see the "Project Specific Multi Select" Field value disappear

        Attachments

          Activity

            People

            Assignee:
            dluksza Dariusz Luksza
            Reporter:
            jmarques Jose Marques
            Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

              Dates

              Created:
              Updated: