Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

How to update a multiple object value in Insight

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
Community showcase
Published in Jira Service Management

JSM Jira Automation: How to Send SLA Breached Notifications

Hi Everyone, In   this tutorial,  we will show you how you can monitor an SLA, and send notifications before or after the SLA has been breached.   SLA Threshold Trigger The SLA t...

731 views 5 13
Read article

Community Events

Connect with like-minded Atlassian users at free events near you!

Find an event

Connect with like-minded Atlassian users at free events near you!

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you