Automatically close the ticket and chat widget after the human handoff is done

If you’d like to automatically close the ticket once the human transfer is completed, you can listen for the ticket:agent_handoff event.

Below is an example code snippet that waits 60 seconds after the handoff, then closes the ticket and hides the widget:

<script>
  window.gleenWidget.on("ticket:agent_handoff", function () {
    setTimeout(function () {
      window.gleenWidget.closeTicket(); // Closes the current ticket
      window.gleenWidget.close();       // Hides the widget
    }, 60000);
  });
</script>

Last updated