Hi,
i havean existing Schema in Assets and i would like to create an External Importer, but ONLY for one partof the structure.
I createda basic structure but it did not work as expected, asit created a complete new object type in the schema.
Is there any possibility to get the current schema. I think it will be very difficult to create the Schema as JSON format description and it takes much much time to do it, because it is very big.
My Structure is like this:
I have added the MDE ObjectType. MDEs are Handhelds. In this case mostly ZEBRA Devices.
We have a Device Management for this and we want to import and update the devices into Assets.
I have created the following mappingstructure:
{
"$schema": "https://api.atlassian.com/jsm/assets/imports/external/schema/versions/2021_09_15",
"schema": {
"objectSchema": {
"name": "Inventory",
"description": "Data imported from Script by ***",
"objectTypes": [
{
"externalId": "object-type/MDE",
"name": "MDE",
"description": "MDE GerAEt von ",
"attributes": [
{
"externalId": "object-type-attribute/name",
"name": "Name",
"description": "Device Unique Identifier",
"type": "text",
"label": true
}
]
}
]
}
},
"mapping": {
"objectTypeMappings": [
{
"objectTypeExternalId": "object-type/MDE",
"objectTypeName": "MDE",
"selector": "MDE",
"description": "Mapping for MDE",
"attributesMapping": [
{
"attributeExternalId": "object-type-attribute/name",
"attributeName": "Name",
"attributeLocators": [
"Name"
],
"externalIdPart": true
}
]
}
]
}
}
{
"data": {
"MDE": [
{
"Name": "Imported MDE"
}
]
},
"completed": true
}
But as you can see it created the new objectType and imported the object.
But i want to import into Company Assets/Hardware/MDE..
How can i do this?
There are many references and inherited attributes and the first look into the json schema structure looked like much much work.
Thank you for your help
Hi,
I've played a little bit now with Assets to actually answer your question :)
> Is there any possibility to get the current schema
Yes. Do `GET /schem-and-mapping` this will return the full JSON representing the schema and mapping configurations.
> But i want to import into Company Assets/Hardware/MDE..
Your schema JSON would need to describe the whole tree down to where you want to add MDE. The mapping, though, does not need the hierarchy. There you only need to say how you want the import to map the attributes tying it all together by means of the externalId.
Hi,
I'm new to Jira Assets, but as I've been reading documentation and seeing your screenshots, could it be that your `externalId` is wrong and points to the root of the classification instead of Company Assets/Hardware/MDE?
Let me know, as I'm embarking on a quest like yours ;)
Best,
Pedro
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.