Hey,
im trying to set up a Listener that stores a Date from a JCF into a Insight Attribute. I cant do it with the standart Postfunctions in a transition do to Workflow resons so i have to build my own.
There is something worng with the AtrributeValueBean but i cant figure out what it ist.
def insight_objekt = issue.getCustomFieldValue(com.atlassian.jira.component.ComponentAccessor.getCustomFieldManager().getCustomFieldObject(10300))[0]
def insight_v= objectFacade.loadObjectAttributeBean(insight_objekt.getId(), 726).getObjectAttributeValueBeans()[0].getValue()
log.warn insight_v //Just show the data of the fild i want to acces
def objectTypeAttributeBean = objectTypeAttributeFacade.loadObjectTypeAttributeBean(726).createMutable() //726
log.warn objectTypeAttributeBean
def objectAttributeBean = insight_objekt.createObjectAttributeBean(objectTypeAttributeBean)
log.warn objectAttributeBean
def objectAtrributeValueBean = objectAttributeBean.createObjectAttributeValueBean()
log.warn objectAtrributeValueBean
def CF_naechste = customFieldManager.getCustomFieldObject(12010) //Date Format
DateValue = issue.getCustomFieldValue(CF_naechste)
log.warn DateValue
objectAtrributeValueBean.setDateValue(new Date(DateValue.getTime()))
log.warn objectAtrributeValueBean
objectAttributeBean.setObjectAttributeValueBeans(objectAtrributeValueBean) // line 82
objectFacade.storeObjectAttributeBean(objectAttributeBean);
Logs:
2021-08-31 13:14:02,008 WARN [runner.ScriptBindingsManager]: ObjectTypeAttributeBean [id=726, name=Nächste Wartung, type=DEFAULT, defaultType=DATE] 2021-08-31 13:14:02,008 WARN [runner.ScriptBindingsManager]: ObjectAttributeBean [objectTypeAttributeId=726, objectId=7136] 2021-08-31 13:14:02,008 WARN [runner.ScriptBindingsManager]: [null(null)] 2021-08-31 13:14:02,008 WARN WARN [runner.ScriptBindingsManager]: 2027-04-19 00:00:00.0 2021-08-31 13:14:02,009 WARN [runner.ScriptBindingsManager]: [null(2027-04-19)] 2021-08-31 13:14:02,012 ERROR [runner.AbstractScriptListener]: ************************************************************************************* 2021-08-31 13:14:02,012 ERROR [runner.AbstractScriptListener]: Script function failed on event: com.atlassian.jira.event.issue.IssueEvent, file: null groovy.lang.MissingMethodException: No signature of method: com.riadalabs.jira.plugins.insight.services.model.MutableObjectAttributeBean.setObjectAttributeValueBeans() is applicable for argument types: (com.riadalabs.jira.plugins.insight.services.model.MutableObjectAttributeValueBean) values: [[null(2027-04-19)]] Possible solutions: setObjectAttributeValueBeans(java.util.List), getObjectAttributeValueBeans(), getObjectAttributeValueBeans() at Script4330.run(Script4330.groovy:82)