Run script on guided failure

When guided failure is enabled I’d like to run a script anytime a step fails before the guided failure dialog comes up. I’m looking for something to send a teams messages to let someone know that the deployment needs attention. Is this possible?

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

Thanks for the quick response. Looks like I can do what I want with subscriptions which is great. Let me know if User Voce would be a better place to put this but it would be nice if subscriptions could run a script instead of just calling a webhook. We have a few more things that need to get notified other than teams when an issue occurs. Thankfully one of these is a custom built environment monitor services that I can have accept a webhook and do everything else we need. Still I’d rather bring that functionality into Octopus so I could have a fallback if the monitoring service is down.

The best place to raise a suggestion would be on our roadmap page.

It would require a bit of extra work, but in theory, you could configure a Runbook on a schedule that runs a script against our REST API (specifically the /api//interruptions endpoints) to check for relevant guided failures and then runs the additional script actions you need if it finds one.