Intercept Event Not Working as Expected on Send Button Actions in Freshdesk

Hi Team,

I’m facing an issue with the events method in our Task Master app on the Freshdesk Marketplace. The app is rendered in the ticket details page.

Our use case is to prevent agents from closing or resolving a ticket without completing all associated tasks. To enforce this, we use the intercept option in the events method. Specifically, we listen to the ticket.propertiesUpdated event to capture status updates when the agent clicks the “Update” button.

If the status is being changed to Closed or Resolved, we check certain conditions. If those conditions fail, we call client.interface.trigger("fail") to block the action.

However, the issue arises when the agent replies to the ticket and selects “Send and set as Close” or “Send and set as Resolve” from the Send button options. In this case, the ticket.propertiesUpdated The event is still triggered, and although client.interface.trigger("fail") is executed, the ticket still gets updated to the Closed status.

I tried using the ticket.sendReply event to differentiate this context, but its payload doesn’t provide enough information to determine whether the agent used the regular “Send” button or selected one of the close options.

How can we reliably detect when the agent selects “Send and set as Close” or “Send and set as Resolve” so we can block the ticket from being closed if tasks are incomplete?