Just a heads up: On March 24, 2025, starting at 4:30pm CDT / 19:30 UTC, the site will be undergoing scheduled maintenance for a few hours. During this time, the site might be unavailable for a short while. Thanks for your patience.
×Hey Folks,
I would like to access the suffix of an attribute of an Insight Object in a groovy script.
But I can not find a method to get the suffix in the Insight API.
In my script I already got an ObjectAttributeBean. The properties of the ObjectAttributeBean do not include the suffix.
Could you tell me the method or provide a code example to get the suffix if it is even possible?
Thanks a lot for your help
You need to get the ObjectTypeAttributeBean which defines the properties of the attribute and call getSuffix() on it. e.g. for a float field with Id 2372 and a suffix set, you could do something like:
import com.atlassian.jira.component.ComponentAccessor
Class objectTypeAttributeFacadeClass = ComponentAccessor.getPluginAccessor().getClassLoader().findClass("com.riadalabs.jira.plugins.insight.channel.external.api.facade.ObjectTypeAttributeFacade")
def objectTypeAttributeFacade = ComponentAccessor.getOSGiComponentInstanceOfType(objectTypeAttributeFacadeClass)
def costObjectTypeAttributeBean = objectTypeAttributeFacade.loadObjectTypeAttributeBean(2372)
def costSuffix = costObjectTypeAttributeBean.getSuffix()
// return suffix ($)
costSuffix
Strangely it doesn't seem to be in the current javadoc for Insight, but it does work for me. ObjectTypeAttributeBean in Insight javadoc 5.1 in case you need more information. Best of luck!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.