Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

How to update a multiple object value in Insight

Julia Gracia December 2, 2021

Hi,

I am trying to update a field of an object. The attribute is object type and has multiple values. This is what I have tried, it gives me this error and I don't know how to fix it

def objectTypeAttributeBeanAnte = objectTypeAttributeFacade.loadObjectTypeAttributeBean(xxxx)

def newValueAnte = issue.getCustomFieldValue(jiraCustomFieldAnte) //Object Array

def atributtosAnte = [] //java.util.ArrayList

for (int i=0; i<newValueAnte.size();i++){
atributtosAnte.add("newValueAnte["+i+"].getName()")
}

def newObjectAttributeBeanAnte = objectAttributeBeanFactory.createObjectAttributeBeanForObject(job, objectTypeAttributeBeanAnte,atributtosAnte)

def objectAttributeBeanAnte = objectFacade.loadObjectAttributeBean(job.getId(), objectTypeAttributeBeanAnte.getId())

if (objectAttributeBeanAnte != null) {
newObjectAttributeBeanAnte.setId(objectAttributeBeanAnte.getId());
}

try {
objectAttributeBeanAnte = objectFacade.storeObjectAttributeBean(newObjectAttributeBeanAnte)
} catch (Exception vie) {
log.warn("Could not update object attribute due to validation exception:" + vie.getMessage())
}

 

ERROR

GroovyInsightException: No signature of method: com.riadalabs.jira.plugins.insight.services.model.factory.ObjectAttributeBeanFactoryImpl.createObjectAttributeBeanForObject() is applicable for argument types: (com.riadalabs.jira.plugins.insight.services.model.ObjectBean, com.riadalabs.jira.plugins.insight.services.model.MutableObjectTypeAttributeBean, java.util.ArrayList) values: [BC_EMPLOYEES_USERSPROCESSOR (SC-1892288), ObjectTypeAttributeBean [id=1846, name=Ancestor, type=REFERENCED_OBJECT, defaultType=NONE], ...] Possible solutions: createObjectAttributeBeanForObject(com.riadalabs.jira.plugins.insight.services.model.ObjectBean, com.riadalabs.jira.plugins.insight.services.model.ObjectTypeAttributeBean, [Ljava.lang.String;), createObjectAttributeBeanForObject(com.riadalabs.jira.plugins.insight.services.model.ObjectBean, com.riadalabs.jira.plugins.insight.services.model.ObjectTypeAttributeBean, java.text.DateFormat, java.text.DateFormat, [Ljava.lang.String;)'

0 answers

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events