Hi everyone!
My problem is based on the jira Mapping Endpoint. Every Time I want to update or upload my Mapping/Schema, it either works or I get this Error Message: Something went wrong. Contact administrator with the Error Code 500, and I simply dont know what the Error is, if im doing something wrong or if Atlassian has some Problems on their end.
This is my Code, the Mapping is a JSON object, which works, because I got the Importer Working, but as I said, sometimes it works and sometimes it doesnt.
response = await api.asUser().requestJira(route`/jsm/assets/workspace/${workspaceId}/v1/importsource/${importId}/mapping`, {
method: "PUT",
body: JSON.stringify(mapping),
headers: {
Accept: "application/json",
"Content-Type": "application/json"
}
});BTW. I first check if there is already a mapping, and then I use the PUT or PATCH HTTP-Request if I need to update it or create it like in the Atlassian Dokumentation: https://developer.atlassian.com/cloud/assets/rest/api-group-importsource/#api-group-importsource
I already tried to change some stuff in the request code block, and the mapping as well, but nothing worked, its just luck based, if it works or not.
I cant show you all of the Mapping because of my work, but here a little snippet I made with one Object and Attribute and everything is like that (of course without the externalIdPart:true on everything):
export const mapping = {
$schema: "https://api.atlassian.com/jsm/assets/imports/external/schema/versions/2021_09_15",
schema: {
objectSchema: {
name: "Importer",
description: "Data imported from ...",
objectTypes: [
{
externalId: "object-type/device",
name: "Device",
description: "Device from ...",
attributes: [
{
externalId: "object-type-attribute/device_id",
name: "ID",
description: "ID of the object",
type: "text"
}
]
}
]
}
},
mapping: {
objectTypeMappings: [
{
objectTypeExternalId: "object-type/device",
objectTypeName: "Device",
selector: "devices",
description: "Mapping for Devices",
attributesMapping: [
{
attributeExternalId: "object-type-attribute/device_id",
attributeName: "ID",
attributeLocators: ["id"],
externalIdPart: true
},
]
}
]
}
};