Set a default value for an Insight object attribute with type = select



I try to set a default value for an Insight object attribute with type 'Select'.

I did an automation script which is launch when an object is created.

I used this script : and I have an error message because the ObjectAttributeValueBeans is null.


Can you help me ?

1 answer

Hi Ludmilla,

Which version of Insight are you using? This documentation is for 4.x, we have documentation for 5.x at

The script does not work out of the box but need some fixes, in particular the ATTRIBUTE_NAME and VALUE needs to be replaced.

The scripts look really similar but has some importing changes according to the new API changes related to Insight 5.

Best Regards


Thank you for your answer. I have the version  5.1.4.

I applied your example but I have this error message :  AutomationRuleGroovyScriptAction, Unexpected error: Cannot invoke method getObjectAttributeValueBeans() on null object
java.lang.NullPointerException: Cannot invoke method getObjectAttributeValueBeans() on null object


This is my script :

import com.atlassian.jira.component.ComponentAccessor;
import com.amundi.jira.*
import conf.*

Class objectFacadeClass = ComponentAccessor.getPluginAccessor().getClassLoader().findClass("");
def objectFacade = ComponentAccessor.getOSGiComponentInstanceOfType(objectFacadeClass);

Class objectTypeAttributeFacadeClass = ComponentAccessor.getPluginAccessor().getClassLoader().findClass("");
def objectTypeAttributeFacade = ComponentAccessor.getOSGiComponentInstanceOfType(objectTypeAttributeFacadeClass);

//Get the value of the 'Jira usage' field
def FlagAttribute = objectFacade.loadObjectAttributeBean(object.getId(), "Jira usage").createMutable()
log.error("FlagAttribute : " + FlagAttribute)
def newFlag = FlagAttribute.getObjectAttributeValueBeans()
log.error("newFlag : " + newFlag)

def valueFlag = FlagAttribute.createObjectAttributeValueBean()
valueFlag.setValue(objectTypeAttributeFacade.loadObjectTypeAttributeBean(FlagAttribute.getObjectTypeAttributeId()), "Servicedesk")

/* Store the object Location into Insight. */
try {
FlagAttribute = objectFacade.storeObjectAttributeBean(FlagAttribute);
} catch (Exception vie) {
log.warn("Could not update attribute Jira usage due to validation exception:" + vie.getMessage());


Could you please update to the latest version 5.2.7 as I know we fixed a bug related to this in 5.2.6
Let us know if the problem persists.

Best Regards

Suggest an answer

Log in or Sign up to answer
Community showcase
Published Feb 07, 2019 in Marketplace Apps

A Timeless Love Story

It started as any story starts, on a normal, rainy day.   Admin meets App, and her name was Klok2, and like any first relationship we were both trying to make it work but neither one knew what...

465 views 8 27
Read article

Atlassian User Groups

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

Find a group

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

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you