Reputation: 385
i'm getting an error every time that i try to import codeTemplates using the service 'POST /codeTemplateLibraries/_bulkUpdate'.
I'm using a node client to send it:
const options = {
method: 'POST',
url: `...`,
headers:
{
'content-type': 'multipart/form-data',
Cookie: this.cookie
},
multipart: {
chunked: true,
data: [
{
'Content-Disposition': "form-data; name='libraries'",
'Content-Type': 'application/xml',
body: `<list>${xmlSetCodeLibs}</list>`
}
,
{
'Content-Disposition': "form-data; name='updatedCodeTemplates'",
'Content-Type': 'application/xml',
body: `<list>${xmlSetCodeTemplates}</list>`
}
]
}
};
Also i tryed, a PUT /codeTemplateLibraries but the result is not what i'm expecting. I receive http status 200 and libraries are inserted, but not the codeTemplates
Upvotes: 0
Views: 967
Reputation: 1835
Having stumbled across the solution myself, I can answer the solution is counter-intuitive at best.
When copying a codeTemplateLibrary (not to be confused with a codeTemplate), Mirth updates both the codeTemplateLibrary and the codeTemplates, but the codeTemplates are not visible. In order to make them visible (and fix the bug), you must then, after doing a full update on the codeTemplateLibrary, update every codeTemplate individually, using the PUT /codeTemplates/{codeTemplateId} call.
So your code solution should:
What you should find after doing steps 4 to 5 for every codeTemplate instance is that the codeTemplate is now visible in Mirth. Yes it is inefficient and slow, but at present it's the only method I've managed to get working.
Upvotes: 1