Run script on guided failure

Hi Jack,

Thanks for getting in touch!

Unfortunately, it isn’t possible to have a notification sent directly from the deployment when the failure occurs, as it does pause all steps from running as soon as the guided failure triggers.

However, you can use the Subscriptions feature to monitor for guided failures and then send an email or webhook notification when one occurs.
There is an event category for guided failure interruptions, and you can scope the subscription to specific projects or environments as desired.
If you want to use the webhook to send the message to Teams, you may need to create an Azure function or similar to consume the JSON payload and then pass it along to Teams. We have an example document for sending to Slack that may help: Subscription webhook notifications - Octopus Deploy

There is another example using Zapier instead of an Azure function here: How can I configure Octopus Deploy to send an alert to MS Teams/Slack etc for a specific security event? - #3 by lianne.crocker

Regards,
Paul