Hello,
I am trying to update an assets object with the information of Jira customfields with scriptrunner HAPI. Some of the attributes can hold multiple values. I I have the code that works for example for objects but I do not seem to make it work for objects with attributes of the type "Jira Project" or "Emails".
I know that I can use this for text fields:
if (teamname) setAttribute('Name', teamname)
Or this for objects
if (objectKey != null) {
architectlist.each { tm ->
def asset = Assets.getByKey(objectKey)
asset.update {
setAttribute('Architect') {
add(tm)
}
}
}
}
But when I try to use the second one to add multiple emails or Jira projects to an attribute field it fails. Does anyone know what should be the correct way? Can it even be done by HAPI or do I have to use regular code?