Hello!
I'm having an issue with a behavior that looks at a checkbox custom field, and sets a single list picker custom field according to the values in the checkbox.
Originally this worked great but with no inline edit, so I added the following function to the initializer script to enable inline edit:
def checkBoxCF = getFieldById("customfield_FIELDID")
checkBoxCF .setAllowInlineEdit(true)The behavior works great if I click on the Edit button, however if I try to utilize the inline edit, the behavior doesn't work. I need to click the edit button and then save (even without changing anything, so it almost seems like it DOES work, but does not commit the change).
For reference, below is my behavior script:
import com.atlassian.jira.issue.customfields.option.Option
import com.atlassian.jira.component.ComponentAccessor
def checkBoxCF = getFieldById("customfield_FIELDID")
def fieldName = "CUSTOMFIELDNAME"
def selectListCF= getFieldById("customfield_FIELDID2")
def optionsManager = ComponentAccessor.getOptionsManager()
def customField = ComponentAccessor.getCustomFieldManager().getCustomFieldObjectByName(fieldName)
def fieldConfig = customField.getRelevantConfig(getIssueContext())
def optionsSelectListCF = optionsManager.getOptions(fieldConfig)
def optionsCheckBoxCF = checkBoxCF .getValue()
//Multiple options
if(optionsCheckBoxCF instanceof List<Option> ){
if(optionsCheckBoxCF.contains("Value1") && optionsCheckBoxCF.contains("Value2") && optionsCheckBoxCF.contains("Value3") && optionsCheckBoxCF.contains("Value4")){
def option = optionsSelectListCFfind {it.value == "B1"}
selectListCF.setFormValue(option.optionId);
}
Question is, how can I have the inline edit work and update the select list correctly? Is there a way to have the script commit the change for a different field? Would I need a different behavior for the select list to commit if it's changed?