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

Come for the products,
stay for the community

The Atlassian Community can help you and your team get more value out of Atlassian products and practices.

Atlassian Community about banner
4,462,434
Community Members
 
Community Events
176
Community Groups

Insight JSON import - How do you refer to the body / header of the JSON in the Selector field

Hi,

I'm struggling with the JSON import to Insight as the JSON I'm working with doesn't have an array for the header (the top level of the JSON). It looks something like this:

{
"attribute1" : "value1",
"attribute2" : "value2",
"attribute3" : "value3",
"attribute4" : "value4",
"attribute5" : {
"attribute6" : "value6",
"attribute7" : "value7",
"attribute8" : "value8" }
}

 Well, the JSON import forces me to include a value in the Selector field, as the field is mandatory.

In the case of the JSON above, a valid selector would be "attribute5", which would allow me to get the values for attributes 6, 7 and 8. But not the values of attributes 1,2, 3 or 4.

So, what is the way of referring in the Selector field of the header (top level of the JSON) so that the importer allows to get the entirety of the JSON in this case?

3 answers

1 vote

Hi,

You are required to have an array in the JSON file. Otherwise the import is quite useless :)

If you don't have a selector name for the first level in the JSON file you can set a dot (.) in the Selector field of the mapping configuration.

Björn

Hey everyone and sorry for bumping this old thread, but this is the first and only related thread regarding this topic and I figured it would be better to document it here in one place. 

I'm basically facing the similar problem as OP. I have a json that defines one object with a lot of attributes. Therefore it also doesn't start with an array, but with a single name. 

So far I was only able to use the array name for the selector, i.e. attribute1. I can then map attribute1_sub1 to insight fields. I could repeat this configuration for all defined arrays (attribute1, attribute2, etc) in the json but I would still be missing the Name field for this import and I have no idea how to work around that limitation. 

Granted, I'm not a json expert, but from what I gathered so far, this seems to be a valid json structure (not starting with an array). 

So I guess my question is: Is not possible to use a wildcard as the selector when using the json importer in insight? If it is possible, what is the syntax?

 

Thanks everyone in advance!

 

{

    "Name": "Here goes the name",
"attribute1": [
        {
            "attribute1_sub1": false,
            "attribute1_sub2": {
                "attribute1_sub2.1": 1,
                "attribute1_sub2.2": "1234-5678"
            },
            "attribute1_sub3": [],
            "attribute1_sub4": [
                {
                    "attribute1_sub4.1": "en-US",
                    "attribute1_sub4.2": "Choose one"
                }
            ]
        }
    ],
    "attribute2": {
        "attribute2_sub1": "EUR",
        "attribute2_sub2": [
            "EUR"
        ]
    },
    "attribute3": [
        {
            "attribute3_sub1": "en-US",
            "attribute3_sub2": "Commercial Description"
        },
        {
            "attribute3_sub3": "de-DE",
            "attribute3_sub4": "Kommerzielle Beschreibung"
        }
    ]
}

Hi did you find a fix for this?

There needs to be an array on top level like this to be able to add a list of items: 


[
{
"attribute1" : "value1",
"attribute2" : "value2",
"attribute3" : "value3",
"attribute4" : "value4",
"attribute5" : {
"attribute6" : "value6",
"attribute7" : "value7",
"attribute8" : "value8"
}
},
{
"attribute1" : "value11",
"attribute2" : "value22",
"attribute3" : "value33",
"attribute4" : "value44",
"attribute5" : {
"attribute6" : "value66",
"attribute7" : "value77",
"attribute8" : "value88"
}
}
]

Like Julia Gracia likes this

Suggest an answer

Log in or Sign up to answer
TAGS

Atlassian Community Events