I'm trying to set the CC of the editor in Freshdesk when the user clicks the reply button. I'm using with App Development Platform v2. It works the first time, but when I discard the draft, and click Reply again, the editor does not load, and the following error is displayed:
Here is a small repro:
function insertCC(client) {
client.interface.trigger("setValue", {id: "cc", value: ["Test CC <testcc@mycompany.net>"]});
}
$(document).ready( function() {
app.initialized()
.then(function(_client) {
console.log("appInit");
var client = _client;
client.events.on("ticket.replyClick", function() { insertCC(client) });
});
});
Exact steps:
1. Load a ticket.
2. Click Reply. The CC field is populated with the value set in code.
3. Discard the draft with the trash can button next to the Send button.
4. Click Reply again. The editor is in half loaded state. Multiple "Property set failed: object in path "replyModel" could not be found or was destroyed." errors are visible in the developer toolbar.