Hi,
I'm trying to get value from Insight Object Attribute (High, Medium, Low) and use that value in IF statement.
Following code is working in Script console:
def customFieldManager = ComponentAccessor.customFieldManager
def customField = customFieldManager.getCustomFieldObject("customfield_27522")
def customFieldValue = issue.getCustomFieldValue(customField)
def myObjectBean = customFieldValue[0]
log.info objectFacade.loadObjectAttributeBean(myObjectBean.getId(), 217).getObjectAttributeValueBeans()[0].getValue()
But when adapt it to Behavior it's just not working at all:
def affectedComponents = getFieldById("customfield_27522") //Affected Component
def af_val = affectedComponents.getValue()
def affCompObjectBean = af_val[0].getId()
def affCompoValue = objectFacade.loadObjectAttributeBean(affCompObjectBean, 217).getObjectAttributeValueBeans()[0].getValue()I'm getting Static type checking errors in both. But Console runs fine and gets me attribute value.
Did anyone manage to get Insight atributes working in Behaviors?
Thanks
Jan