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.
Online forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.