Slack Notifications

Follow the steps below to configure a webhook for receiving Zammad notifications in a Slack channel.

Step 1 - Setup Incoming WebHooks App in your Slack Channel

In your target Slack Channel, click on the channel name in the upper left part of the screen to get to channel details.

Accessing Channel Details in a Slack Channel

Switch to Integrations tab and click on Add an App button.

Adding an App to Slack Channel

On the next screen, search for an app called Incoming WebHooks and click on Install button next to it.

Searching for Creating Incoming Webhook Connector

You will be redirected to the Slack App Directory website, where you can add the app.

Click on Add to Slack button.

Adding Incoming WebHooks App to Slack

On the next screen, in Post to Channel choose your channel from the list and click on Add Incoming WebHooks integration button.

Configuring Post to Channel Settings of Incoming WebHooks App

In the final screen, scroll down to Integration Settings.

Make sure to copy Webhook URL to clipboard and save it for later. You can do this in one click via the Copy URL link shown right below the field.

You can also fill Customize Name field with an appropriate username for the incoming webhooks integration, as this will be used for all of the notification messages in the channel.

Optionally, you can Customize Icon which will be used as the avatar.

Integration Settings of Incoming WebHooks App

Finally, save your app configuration by clicking Save Settings.

Step 2 - Add a Pre-defined Webhook in Zammad

Go to Webhook management screen in your Zammad instance and click on the arrow next to the green button in the upper right corner. Choose Pre-defined Webhook from the dropdown menu.

New Pre-defined Webhook button

In the subsequent modal dialog, select Slack Notifications as the pre-defined webhook.

New Slack Notifications Pre-defined Webhook modal

Click Next.

In the new dialog, paste Webhook URL from Slack App into Endpoint field.

Configuring Slack Webhook endpoint

Finally, click on Submit.

Step 3 - Configuring a Trigger for firing of the Webhook

As a last step, you need to create a Trigger for posting a notification to the Slack channel under certain conditions.

Once the trigger is in place, your webhook is ready for use!

Sample Slack Channel Notification

From now on, whenever a ticket is escalated or has reached escalation warning in your Zammad system, a suitable notification will be posted in the configured Slack Channel. The notification will contain the link to the ticket, escalation information and content of the last article. It will also be color coded according to its latest state.

Sample Slack Channel Notification

Removing Article Content from the Slack Notification

If you are concerned about leaking sensitive article content via notifications, there is a way to remove them by further customizing the webhook payload.

Find your webhook in the list on the management screen and click on it to edit it.

Switch on Custom Payload and the code editor below will be shown, pre-populated with the default payload.

Next, identify the line starting with "text": "... block in the JSON structure.

Custom Payload for Slack Webhook

Scroll horizontally to the end of the line and select \n\n#{notification.body} part near the end. Be sure not to include the end double quote with comma (",) in the rest of the line, since the new payload must remain a valid JSON value.

Custom Payload with Article Content for Slack Webhook

Then, simply delete the selected code.

Custom Payload w/o Article Content for Slack Webhook

Finally, click on Submit to save your webhook changes.

On the next invocation of the webhook, the notification will not include content of the last article.