What is wrong with my schema?
Asked by Maximilian Bleier:

Hey, I'm trying to write a custom importer for Jira Assets. I can't get my custom schema to work. I get the error message: "Something went wrong. Contact administrator"  

I get this when I send the PUT request with the schema  

\`\`\`json  
{  
"$schema": "<https://api.atlassian.com/jsm/assets/imports/external/schema/versions/2021_09_15>",  
"schema": {  
"objectSchema": {  
"name": "Agent",  
"description": "Agents monitored by Wazuh",  
"objectTypes": \[  
{  
"externalId": "object-type/agent",  
"name": "Agent",  
"description": "Agents monitored by Wazuh",  
"attributes": \[  
{  
"externalId": "object-type-attribute/ip",  
"name": "ip",  
"description": "Ip",  
"type": "text"  
},  
{  
"externalId": "object-type-attribute/id",  
"name": "id",  
"description": "Id",  
"type": "text"  
},  
{  
"externalId": "object-type-attribute/status_code",  
"name": "status_code",  
"description": "Status code",  
"type": "text"  
},  
{  
"externalId": "object-type-attribute/version",  
"name": "version",  
"description": "Version",  
"type": "text"  
},  
{  
"externalId": "object-type-attribute/group_config_status",  
"name": "group_config_status",  
"description": "Group config status",  
"type": "text"  
},  
{  
"externalId": "object-type-attribute/name",  
"name": "name",  
"description": "Name",  
"type": "text"  
},  
{  
"externalId": "object-type-attribute/lastKeepAlive",  
"name": "lastKeepAlive",  
"description": "Lastkeepalive",  
"type": "text"  
},  
{  
"externalId": "object-type-attribute/node_name",  
"name": "node_name",  
"description": "Node name",  
"type": "text"  
},  
{  
"externalId": "object-type-attribute/status",  
"name": "status",  
"description": "Status",  
"type": "text"  
},  
{  
"externalId": "object-type-attribute/manager",  
"name": "manager",  
"description": "Manager",  
"type": "text"  
},  
{  
"externalId": "object-type-attribute/registerIP",  
"name": "registerIP",  
"description": "Registerip",  
"type": "text"  
},  
{  
"externalId": "object-type-attribute/dateAdd",  
"name": "dateAdd",  
"description": "Dateadd",  
"type": "text"  
},  
{  
"externalId": "object-type-attribute/mergedSum",  
"name": "mergedSum",  
"description": "Mergedsum",  
"type": "text"  
},  
{  
"externalId": "object-type-attribute/group",  
"name": "group",  
"description": "Group",  
"type": "text"  
},  
{  
"externalId": "object-type-attribute/configSum",  
"name": "configSum",  
"description": "Configsum",  
"type": "text"  
},  
{  
"externalId": "object-type-attribute/disconnection_time",  
"name": "disconnection_time",  
"description": "Disconnection time",  
"type": "text"  
}  
\],  
"children": \[  
{  
"externalId": "object-type/os",  
"name": "os",  
"description": "os",  
"attributes": \[  
{  
"externalId": "object-type-attribute/osarch",  
"name": "arch",  
"description": "Arch",  
"type": "text"  
},  
{  
"externalId": "object-type-attribute/oscodename",  
"name": "codename",  
"description": "Codename",  
"type": "text"  
},  
{  
"externalId": "object-type-attribute/osmajor",  
"name": "major",  
"description": "Major",  
"type": "text"  
},  
{  
"externalId": "object-type-attribute/osminor",  
"name": "minor",  
"description": "Minor",  
"type": "text"  
},  
{  
"externalId": "object-type-attribute/osname",  
"name": "name",  
"description": "Name",  
"type": "text"  
},  
{  
"externalId": "object-type-attribute/osplatform",  
"name": "platform",  
"description": "Platform",  
"type": "text"  
},  
{  
"externalId": "object-type-attribute/osuname",  
"name": "uname",  
"description": "Uname",  
"type": "text"  
},  
{  
"externalId": "object-type-attribute/osversion",  
"name": "version",  
"description": "Version",  
"type": "text"  
}  
\]  
}  
\]  
}  
\]  
}  
},  
"mapping": {  
"objectTypeMappings": \[  
{  
"objectTypeExternalId": "object-type/agent",  
"objectTypeName": "Agent",  
"selector": "agent",  
"description": "Mapping for Agent",  
"attributesMapping": \[  
{  
"attributeExternalId": "object-type-attribute/configSum",  
"attributeName": "configSum",  
"attributeLocators": \[  
"configSum"  
\]  
},  
{  
"attributeExternalId": "object-type-attribute/dateAdd",  
"attributeName": "dateAdd",  
"attributeLocators": \[  
"dateAdd"  
\]  
},  
{  
"attributeExternalId": "object-type-attribute/disconnection_time",  
"attributeName": "disconnection_time",  
"attributeLocators": \[  
"disconnection_time"  
\]  
},  
{  
"attributeExternalId": "object-type-attribute/group",  
"attributeName": "group",  
"attributeLocators": \[  
"group"  
\]  
},  
{  
"attributeExternalId": "object-type-attribute/group_config_status",  
"attributeName": "group_config_status",  
"attributeLocators": \[  
"group_config_status"  
\]  
},  
{  
"attributeExternalId": "object-type-attribute/id",  
"attributeName": "id",  
"attributeLocators": \[  
"id"  
\]  
},  
{  
"attributeExternalId": "object-type-attribute/ip",  
"attributeName": "ip",  
"attributeLocators": \[  
"ip"  
\]  
},  
{  
"attributeExternalId": "object-type-attribute/lastKeepAlive",  
"attributeName": "lastKeepAlive",  
"attributeLocators": \[  
"lastKeepAlive"  
\]  
},  
{  
"attributeExternalId": "object-type-attribute/manager",  
"attributeName": "manager",  
"attributeLocators": \[  
"manager"  
\]  
},  
{  
"attributeExternalId": "object-type-attribute/mergedSum",  
"attributeName": "mergedSum",  
"attributeLocators": \[  
"mergedSum"  
\]  
},  
{  
"attributeExternalId": "object-type-attribute/name",  
"attributeName": "name",  
"attributeLocators": \[  
"name"  
\]  
},  
{  
"attributeExternalId": "object-type-attribute/node_name",  
"attributeName": "node_name",  
"attributeLocators": \[  
"node_name"  
\]  
},  
{  
"attributeExternalId": "object-type-attribute/registerIP",  
"attributeName": "registerIP",  
"attributeLocators": \[  
"registerIP"  
\]  
},  
{  
"attributeExternalId": "object-type-attribute/status",  
"attributeName": "status",  
"attributeLocators": \[  
"status"  
\]  
},  
{  
"attributeExternalId": "object-type-attribute/status_code",  
"attributeName": "status_code",  
"attributeLocators": \[  
"status_code"  
\]  
},  
{  
"attributeExternalId": "object-type-attribute/version",  
"attributeName": "version",  
"attributeLocators": \[  
"version"  
\]  
}  
\]  
},  
{  
"objectTypeExternalId": "object-type/os",  
"objectTypeName": "os",  
"selector": "os",  
"description": "Mapping for os",  
"attributesMapping": \[  
{  
"attributeExternalId": "object-type-attribute/osarch",  
"attributeName": "arch",  
"attributeLocators": \[  
"arch"  
\]  
},  
{  
"attributeExternalId": "object-type-attribute/oscodename",  
"attributeName": "codename",  
"attributeLocators": \[  
"codename"  
\]  
},  
{  
"attributeExternalId": "object-type-attribute/osmajor",  
"attributeName": "major",  
"attributeLocators": \[  
"major"  
\]  
},  
{  
"attributeExternalId": "object-type-attribute/osminor",  
"attributeName": "minor",  
"attributeLocators": \[  
"minor"  
\]  
},  
{  
"attributeExternalId": "object-type-attribute/osname",  
"attributeName": "name",  
"attributeLocators": \[  
"name"  
\]  
},  
{  
"attributeExternalId": "object-type-attribute/osplatform",  
"attributeName": "platform",  
"attributeLocators": \[  
"platform"  
\]  
},  
{  
"attributeExternalId": "object-type-attribute/osuname",  
"attributeName": "uname",  
"attributeLocators": \[  
"uname"  
\]  
},  
{  
"attributeExternalId": "object-type-attribute/osversion",  
"attributeName": "version",  
"attributeLocators": \[  
"version"  
\]  
}  
\]  
}  
\]  
}  
}\`\`\`  
Am I doing something wrong? I wasted 2 days trying to import smth into assets.  


Answers:
author: Maximilian Bleier
body: Here is a reduced version:  
{  
"$schema": "<https://api.atlassian.com/jsm/assets/imports/external/schema/versions/2021_09_15>",  
"schema": {  
"objectSchema": {  
"name": "Agent",  
"description": "Agents monitored by Wazuh",  
"objectTypes": \[  
{  
"externalId": "object-type/agent",  
"name": "Agent",  
"description": "Agents monitored by Wazuh",  
"attributes": \[  
{  
"externalId": "object-type-attribute/ip",  
"name": "ip",  
"description": "Ip",  
"type": "text"  
}  
\],  
"children": \[  
{  
"externalId": "object-type/os",  
"name": "os",  
"description": "os",  
"attributes": \[  
{  
"externalId": "object-type-attribute/osarch",  
"name": "arch",  
"description": "Arch",  
"type": "text"  
}  
\]  
}  
\]  
}  
\]  
}  
},  
"mapping": {  
"objectTypeMappings": \[  
{  
"objectTypeExternalId": "object-type/agent",  
"objectTypeName": "Agent",  
"selector": "agent",  
"description": "Mapping for Agent",  
"attributesMapping": \[  
{  
"attributeExternalId": "object-type-attribute/configSum",  
"attributeName": "configSum",  
"attributeLocators": \[  
"configSum"  
\]  
}  
\]  
},  
{  
"objectTypeExternalId": "object-type/os",  
"objectTypeName": "os",  
"selector": "os",  
"description": "Mapping for os",  
"attributesMapping": \[  
{  
"attributeExternalId": "object-type-attribute/osarch",  
"attributeName": "arch",  
"attributeLocators": \[  
"arch"  
\]  
}  
\]  
}  
\]  
}  
}  

still 500 internal server error

comments: author: Bruna Silva
body: Hello [@Maximilian Bleier](/t5/user/viewprofilepage/user-id/5538575)

To ensure we can assist you effectively with this case, I have created a support ticket on your behalf.

You should have received an email notification confirming this. :)

Regards,  
**Bruna**


Tags: assets

cloud

jira-cloud