Details
-
Type:
Bug
-
Status: Triage
-
Priority:
Medium
-
Resolution: Unresolved
-
Affects Version/s: 5.6.1, 5.6.6
-
Fix Version/s: None
-
Component/s: Behaviours, Third-Party Apps
-
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