I have a schema that has already been implemented. I don't need to modify it. I am trying to execute an external import but I'm stuck on what the required JSON is. I'm assuming that I need to include the $schema keyword and the target schema make but the schema dialect definition also requires the schema description and objectTypes keywords. This seems like overkill if I'm not changing the schema.
I searched around and found https://community.atlassian.com/t5/Jira-Service-Management/insight-external-import-how-to-patch-import-mapping-with/qaq-p/2102647 which indicates that a PATCH call can be made including only the changes to the schema but all of the mappings. Given this I tried including an empty objectTypes but the call fails, stating that the objectTypes is not configured.
This seems like a very standard use case so maybe I'm missing something basic?
Eh so I kinda figured this out. If the schema has already been created and you want to just import data add the object type to the schema and mapping. So something like:
{ "$schema": "https://api.atlassian.com/jsm/insight/imports/external/schema/versions/2021_09_15", "schema": { "objectSchema": { "name": "CMDB", "description": "", "objectTypes": [ { "name": "Virtual Machine", "description": "" } ] } }, "mapping": { "objectTypeMappings": [ { "objectTypeName": "Virtual Machine", "description": "", "selector": "vm" } ] }}
Not sure if this the correct way but it works when sending a PATCH. I can't get it to work with a PUT so my assumption is that PATCH is the method that must be used.
It looks like you're new here. Sign in or register to get started.