Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in
Celebration

Earn badges and make progress

You're on your way to the next level! Join the Kudos program to earn points and save your progress.

Deleted user Avatar
Deleted user

Level 1: Seed

25 / 150 points

Next: Root

Avatar

1 badge earned

Collect

Participate in fun challenges

Challenges come and go, but your rewards stay with you. Do more to earn more!

Challenges
Coins

Gift kudos to your peers

What goes around comes around! Share the love by gifting kudos to your peers.

Recognition
Ribbon

Rise up in the ranks

Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!

Leaderboard

External imports without schema changes

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

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.

Suggest an answer

Log in or Sign up to answer
DEPLOYMENT TYPE
CLOUD
PRODUCT PLAN
PREMIUM
PERMISSIONS LEVEL
Site Admin
TAGS
AUG Leaders

Atlassian Community Events