Generate incoming Webhook URL on Slack

I’d like Mitto to send a notification to a company slack channel when my master sequence fails. I’m not sure where to find the Slack URL to add to the webhook configuration in Mitto.

Is this something I generate for myself, per Mitto job, or does a single URL exist for a Slack workspace?

A Mitto job can send a POST request via a webhook on a job event (start, complete, success, and/or failure).

To send a POST request to Slack you need a Slack app that is configured for incoming webhooks. Here’s the Slack documentation on setting that up: Sending messages using Incoming Webhooks | Slack

Thanks! So does this become a best practices question as to if each Slack user creates their own app vs having a company wide app that users can collaborate with?

Zuar has a company wide app for internal Mitto alerting purposes. Certain Slack plans have a limit on the number of apps. I would assume having a single app rather than app per person is the best practice.

Here’s a POST request template I use for Mitto job notifications in Slack:

Basic Mitto Slack Webhook

Event: JOB_FAILURE
Method: POST
Content Type: application/json
Body:

{ 
    "text": "Job Failed!: ${system['fqdn']} - ${job['title']}\nhttps://${system['fqdn']}/#!/job/${job['id']}"
}

Example result:
image

Fancy Mitto Slack Webhook

This example uses Slack’s Block Kit.

Event: JOB_FAILURE
Method: POST
Content Type: application/json
Body:

{
  "blocks": [
    {
      "type": "section",
      "text": {
        "type": "mrkdwn",
        "text": ":rotating_light: Mitto Job Failed!"
      }
    },
    {
      "type": "section",
      "text": {
        "type": "mrkdwn",
        "text": "Mitto URL: https://${system['fqdn']}\nJob Title: ${job['title']}\nJob URL: https://${system['fqdn']}/#!/job/${job['id']}"
      }
    }
  ]
}

Example result:
image

1 Like

@chad.bernstein Here is the relevant information on setting up your Slack channel