The Atlassian Community Forums are currently in read-only mode. We will be relaunching on a new platform on September 22 (read more here). We apologize for the extended downtime. For concerns or questions, please email communitymanagers@atlassian.com. See you on the other side, on the new Atlassian Community Forums! :)

×

Forums

Articles
Create
cancel
Showing results for 
Search instead for 
Did you mean: 

External imports without schema changes

Boswell, Richard
Contributor
September 10, 2022

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?

1 answer

Comments for this post are closed

Community moderators have prevented the ability to post new answers.

0 votes
Boswell, Richard
Contributor
October 3, 2022

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.

DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Product Admin
TAGS
AUG Leaders

Atlassian Community Events