deleteQuotedText - Unwanted behavior?

Hey Community,

I experience some unexpected behavior with removing quoted text in email reply editor.

So what I try to achieve is to remove the quoted text only for a specific ticket.product_id.

Thats my code:

var client;

init();

async function init() {
  client = await app.initialized();
  client.events.on('app.activated', appActivated);
  client.events.on("ticket.replyClick", onReplyClicked);
}
async function onReplyClicked() {
  const [iparams, ticketData] = await Promise.all([
    client.iparams.get(),
    client.data.get("ticket")
  ]);
  if (iparams.ticketProducts.includes(ticketData.ticket.product_id)) {
    try {
      await client.interface.trigger("click", { id: "deleteQuotedText" });
      console.log("Action executed because product ID matched.");
    } catch (error) {
      console.error("Error executing action:", error);
    }
  } else {
    console.log("Product ID does not match. Action not executed.");
  }
}

Testing it on a single ticket works perfectly fine, so

  • Open ticket
  • Click on reply
  • Send the email
  • No quoted text at receiver’s side

So now assuming, that the next ticket is a ticket, which does not match configured products (iparams.ticketProducts).
When I go to that next ticket with key ‘j’ or if the next ticket loads automatically, because I close/resolve the first one on sending, the quoted text is missing aswell (in UI and at receiver’s side)!
And that happens even though I see my comment:
image

Only after I reload the whole “non matching” ticket, I can send quoted text again.

It seems that the “deleteQuotedText” is removing quoted text for as long as the ticket details page isn’t fully reloaded, where I’d have expected to check for each ticket loaded.

Anyone else experienced this issue? Anyone resolved it?

Looking forward to your suggestions.

Thank you and Best regards
Tom

@Freddy - Any suggestions on how to use the “deleteQuotedText” feature properly, that it reacts correct for each ticket?

Thx

Hey Community

No one ever had this usecase or tried the same?
As soon as you do communicate with other ticket systems (so B2B communication) or marketplaces (e.g. Amazon), it does make sense to not send quoted text.
And for customer tickets it does as it is mostly the good old way of sending emails.

As our agents do handle both in parallel, we need to be able to turn quoted text off on a per ticket basis without a complete reload of the page.

Help urgently needed - Thank you
Tom