Set Field Value in Behavior doesn't work for CF++

Description

In the code below in Behavior, the options are retrieved correctly, but the updated options (to narrow down the list based on another field's value) cannot be set in the CF++:

def descField = getFieldById("description") //to Test

def customFieldManager = ComponentAccessor.getCustomFieldManager()
def optionsManager = ComponentAccessor.getOptionsManager()

// Get a pointer to my select list field
def selectList = getFieldById(consultingAreaCFID)
// Get access to the required custom field and options managers
def consultingAreaCF = customFieldManager.getCustomFieldObject(selectList.getFieldId())
def config = consultingAreaCF.getRelevantConfig(getIssueContext())
def options = optionsManager.getOptions(config)
String testString = options.toString() + " \n-----------\n "
// define an empty map containing 0 values.
// Set the values inside the select list field
/*
def optionsToSelect = [null: "None"]
optionsToSelect += options.findAll {
it.value =~ "Network" //ToDo get FP-CA-Abb dynamically
}.collectEntries {
[(it.optionId.toString()): it.value]
}
*/
def optionsToSelect = options.findAll { it.value =~ "B" } //it.value in ["Oranges", "Lemons"]
testString = testString + optionsToSelect.toString() + " \n################\n "
descField.setFormValue(testString) //optionsToSelect.get (0)
// Apply the selected options to the field to clear all of its values.
selectList.setFormValue(optionsToSelect*.optionId)
//the line above doesn't have any effects on the options shown

Environment

None

Activity

Show:
Deniz Oğuz
March 26, 2019, 3:03 PM

Hi, could you give more description. We have fixed this issue in 1.6.4 version, are you using the latest version?

Deniz Oğuz
March 28, 2019, 9:38 AM

Sorry, I have tried to fix this a lot but I couldn't. I have contacted Adaptavist support again. Here is the issue for you to check, https://productsupport.adaptavist.com/browse/SRJIRA-3079

Assignee

Deniz Oğuz

Reporter

Pujan Ziaie

Labels

None

Source

None

Jira Version

None

Database Type/Version

None

Browser Type/Version

None

Priority

Major
Configure