Behaviours checkboxes - missing value

Rafał Falisz June 22, 2023

Hello,

Idea: 
I have a Checkbox field (multi select field) with available values : ( "CTI" / "B" / "C). If user creating ticket checks value A (in any configuration) I want to display another text field -

"Mobile phone number (Employee) "

Script: 

def crm = getFieldByName('CRM - additional information')
log.debug(crm)

def val1 = crm.getValue().each {} as String
log.debug(val1)

if (val1=="CTI") {
    getFieldByName('Mobile phone number (Employee)').setHidden(false).setRequired(true)
    log.debug("works")
} else {
    getFieldByName('Mobile phone number (Employee)').setHidden(true).setRequired(false)
    log.debug("ffs")
}

logs:

2023-06-22 14:42:11,562 DEBUG [runner.ScriptBindingsManager]: Form field ID: customfield_12121, value: 
2023-06-22 14:42:11,562 DEBUG [runner.ScriptBindingsManager]: Form field ID: customfield_12121, value:
2023-06-22 14:42:11,564 DEBUG [runner.ScriptBindingsManager]:
2023-06-22 14:42:11,564 DEBUG [runner.ScriptBindingsManager]:
2023-06-22 14:42:11,565 DEBUG [runner.ScriptBindingsManager]: ffs
2023-06-22 14:42:11,565 DEBUG [runner.ScriptBindingsManager]: ffs

This code works perfectly fine when i use different field type - single select field.
Why there is no returned value? What am I doing wrong? 

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events