Good afternoon,
I am stuck with groovy automation script, which will create new object type with given name string in object schema.
I tested a lot with insight classes. ObjectTypeFacade class has a method createObjectTypeBean(com.riadalabs.jira.plugins.insight.services.model.MutableObjectTypeBean objectTypeBean), but it is used as i understood to convert MutableObjectTypeBean to ObjectTypeBean.
I have no clue whether it is possible to create new object type with groovy script at all.
I also tried with ImmutableFactory https://insight-javadoc.riada.io/insight-javadoc-5.4.2/index.html?com/riadalabs/jira/plugins/insight/services/model/ImmutableFactory.html
def immutableFactory = ComponentAccessor.getOSGiComponentInstanceOfType(ComponentAccessor.getPluginAccessor().getClassLoader().findClass("com.riadalabs.jira.plugins.insight.services.model.ImmutableFactory"));
def newObjectType = immutableFactory.createObjectType(name=someString);but it gives me an error:
MissingMethodException: No signature of method: com.riadalabs.jira.plugins.insight.channel.external.api.facade.impl.ObjectFacadeImpl.createObjectType() is applicable for argument types: (java.lang.String)
Does anyone has a solution to create this MutableObjectTypeBean which is used to set the data? The following doesn't work either.
def mutableObjectTypeBean = ComponentAccessor.getOSGiComponentInstanceOfType(ComponentAccessor.getPluginAccessor().getClassLoader().findClass("com.riadalabs.jira.plugins.insight.services.model.MutableObjectTypeBean"));
MutableObjectTypeBean newObjectType = new MutableObjectTypeBean();And is it possible just to parse Name and ParentObjectTypeId properties, because if i give it a random Id also, this might make a conflict as the id could be already in use.