Slack message directly to user of failed build

Instead of posting to a public channel, I would like the failed build Slack message to be sent directly to the owner of the commit as an IM. Is this possible?

Hi there!

We discussed this on Intercom, but it might be interests other as well so let me reply here too,

You have multiple options with the Slack step, the one we’re recommending at the moment, is in fact to create a bot user and use and API TOKEN, through which you can also send direct messages.

The tricky part of your question would be to only ping people when the build fails. To achieve that, you would have to set the slack step in the .yml to something like: run_if: .IsBuildFailed

You can check out our relevant documentation on how to conditionally enable/disable steps: https://devcenter.bitrise.io/tips-and-tricks/disable-a-step-by-condition/#disable-a-step

I was able to get IsBuildFailed working but how do you know the user id to send the message to?

@gpeal8 I will be replying thoroughly to your questions on Intercom (but we’re mostly discussing step configuration from now) to avoid having the same conversation twice, hope that’s okay :slight_smile:

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.