Hello. I'm struggling my way through trying to create an external import using the info here:
Insight external imports workflow (atlassian.com)
External Imports - Schema and mapping (atlassian.com)
Finally got the import working until I introduced reference attributes. I've updated the schema JSON but when I PATCH using the updated JSON schema I get this error:
{"jsonValidationErrors":[],"dataValidationErrors":[{"code":"REFERENCED_OBJECT_TYPE_CHANGED","location":"testEmployee.Office"},{"code":"REFERENCED_OBJECT_TYPE_CHANGED","location":"testEmployee.Manager"}],"status":"error"}
This is the JSON schema definition I'm using - if I remove the reference attributes then PATCH works:
{
"$schema": "https://api.stg.atlassian.com/jsm/insight/imports/external/schema/versions/2021_09_15",
"schema": {
"objectSchema": {
"name": "Testing",
"description": "Testing schema",
"objectTypes": [
{
"name": "testEmployee",
"description": "my test employee",
"attributes": [
{
"name": "Name",
"description": "DisplayName of the Employee",
"type": "text",
"label": true
}, {
"name": "FirstName",
"description": "First name of employee",
"type": "text"
}, {
"name": "LastName",
"description": "Last name / Surname of employee",
"type": "text"
}, {
"name": "Office",
"description": "Primary office of employee",
"type": "referenced_object",
"referenceObjectTypeName": "testOffice"
}, {
"name": "Manager",
"description": "Manager of the employee",
"type": "referenced_object",
"referenceObjectTypeName": "testEmployee"
}
]
},
{
"name": "testOffice",
"description": "my test office",
"attributes": [
{
"name": "Name",
"description": "Name of the office",
"type": "text",
"label": true
}
]
}
]
}
},
"mapping": {
"objectTypeMappings": [
{
"objectTypeName": "testEmployee",
"selector": "",
"description": "Import mapping for testEmployee",
"attributesMapping": [
{
"attributeName": "Name",
"attributeLocators": [
"DisplayName"
],
"externalIdPart": true
}, {
"attributeName": "FirstName",
"attributeLocators": [
"FirstName"
]
}, {
"attributeName": "LastName",
"attributeLocators": [
"LastName"
]
}, {
"attributeName": "Office",
"attributeLocators": [
"Office"
],
"objectMappingIQL": "Name = ${Office}"
}, {
"attributeName": "Manager",
"attributeLocators": [
"Manager_DisplayName"
],
"objectMappingIQL": "Name = ${Manager_DisplayName}"
}
]
}
]
}
}The attributes are defined like this:

I expect I'm not understanding something fundamental but cannot see it at present. Hoping someone else can point me in the right direction.
For reference, I'm using Microsoft Flow to update Insight with information from a SharePoint (Microsoft 365) list. This list consolidates information from various LOB apps. The plan is to schedule this Flow to update Insight regularly.
Thanks.
Ian.