Hey Guys,
At the moment I'm working on a JiraInsight Java Plugin with Riada.Jira.Plugins.
I try to generate the structure with the getPredefinedStructure Method which you can overwrite in the module.
I have no idea how I can create an Object Type Reference to an existing Object Type that I don't want to create in this predefinedStructure.
I used this as an example: https://bitbucket.org/mathiasedblom/insight-import-module-tempo-account/src/master/src/main/java/com/riadalabs/jira/plugins/insight_tempo_accounts/manager/TempoStructureManager.java
There is nothing documented what you can do if an Object type is already created and you just want to create the Object Type Reference to it.
When I create the (already existing) Object Type like this:
ObjectTypeExternal alreadyExistingObjectTypeExternal = new ObjectTypeModuleExternal(
TempoSelector.CUSTOMER.getSelector(), true, null);
rootObjectTypeExternal.getObjectTypeChildren().add(alreadyExistingObjectTypeExternal);
alreadyExistingObjectTypeExternal.setId(objectTypeSequenceNumber++);
alreadyExistingObjectTypeExternal.setName("Tempo Customers");
...I have an error in my logs:
2022-04-01 09:46:25,985 [http-nio-8080-exec-6] | Unable to store object type attribute ObjectTypeAttributeBean [id=null, name=ArchitectureElements, type=REFERENCED_OBJECT, defaultType=NONE] for object type ObjectTypeBean [id=404, name=ServiceDefinition] ValidationInsightException: Validation errors were found: typeValue: ErrorMessage{i18nKey='rlabs.insight.i18n.constraint.violation.ObjectTypeAttributeBean.Invalid.referenceObjectTypeId', parameters=[], additionalMessage=null};
2022-04-01 09:51:36,980 [http-nio-8080-exec-15] | Unable to insert object type ObjectTypeBean [id=null, name=ArchitectureElement] will skip this object type
com.riadalabs.jira.plugins.insight.common.exception.ValidationInsightException: ValidationInsightException: Validation errors were found: name: ErrorMessage{i18nKey='rlabs.insight.i18n.constraint.violation.ObjectTypeBean.NotUnique.name', parameters=[], additionalMessage=null};
I have no idea how you can do that and I didn't find any documentation.
Can someone help here?
Thanks and BR, Sandro