Insight: Create and link multiple objects in multiple object types on import

Bernhard Wendel (HM) June 20, 2018

Hi all,

 

I'm trying to import into multiple object types with only one import. In my case I have the object types PC and Software. And a PC can have references to multiple Software objects.

 

Both object types only have a name field. The PC type additionally has a reference to Software. Now what I want to do is import into both object types from the same import while also creating several referemced objects.

 

Say, I have the following simple Import file:

[
    {
        "name": "Computer 1",
        "software": "SW1||SW2||SW3"
    }
]

 

The name attribute will create a PC and all the values in the software attribute should creates Software objects. The current import configuration looks like this:

Import_software.pngImport_PC.png

 

This creates the PC and an object with the name "SW1||SW2||SW3" in Software (without linking them).

 

How do I get Insight to create 3 individual Software objects and link them to the PC?

 

Since I control the import file, I can also apply changes there if necessary.

 

Regards

 

 

 

2 answers

1 accepted

0 votes
Answer accepted
Bernhard Wendel (HM) June 21, 2018

So, the final answer is: It is possible and works reliably.

 

You can also pass multiple attributes per object type:

{
    "software": [
        {"name": "SW1", "vendor": "MS"},
        {"name": "SW2", "vendor": "MS"},
        {"name": "SW3", "vendor": "Adobe"}
    ],
    "computer": [
        {
            "name": "Computer 1",
            "software": "SW1||SW3"
        }
    ]
}

 

And since everything is nicely together in one file, you only need one import configuration.

0 votes
PJ Wysota
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 20, 2018

Well, You will not. :-) Here is a post from me, that could help you (subsequent imports need to be done), but as discussed with RIada - there are currently no options to CREATE referenced objects on imports - the only upgrade of this functionality they think of currently is maybe some sequencing imports to allow creating referenced objects first and then relate to them.

https://blog.valiantys.com/en/expert-tips/insight-for-jira

Bernhard Wendel (HM) June 20, 2018

Thanks for your reply, but apparently you are wrong here. Let me explain:

{
    "software": [
        {"name": "SW1"},
        {"name": "SW2"},
        {"name": "SW3"},
        {"name": "SW4"},
        {"name": "SW5"},
        {"name": "SW6"},
        {"name": "SW7"},
        {"name": "SW8"},
        {"name": "SW9"},
        {"name": "SW10"}
    ],
    "computer": [
        {
            "name": "Computer 1",
            "software": "SW1||SW3"
        }
    ]
}

Using this as an import file and setting up the mappings (Computer with selector = computer; Software with selector = software) will yield the expected results: After the import finishes, there will be 1 computer with 2 references to software.

 

When you clean out both object types, this can be reproduced several times.

PJ Wysota
Rising Star
Rising Star
Rising Stars are recognized for providing high-quality answers to other users. Rising Stars receive a certificate of achievement and are on the path to becoming Community Leaders.
June 21, 2018

Do you are doing EXACTLY what we have discuss with Riada - sequencing import. SW objects go first. Then you create PC with referencje to just create, but already EXISTING SW objects. :)

Suggest an answer

Log in or Sign up to answer