Skip to content

Latest commit

 

History

History
165 lines (118 loc) · 5.67 KB

slack-notifications.rst

File metadata and controls

165 lines (118 loc) · 5.67 KB

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.

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

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

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

Click on Add to Slack button.

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

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.

Finally, save your app configuration by clicking Save Settings.

Step 2 - Add a Pre-defined Webhook in Zammad

Go to Webhook </manage/webhook/add> 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.

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

Click Next.

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

Finally, click on Submit.

Step 3 - Configuring a Trigger for firing of the Webhook

As a last step, you need to create a Trigger <generic-notifications-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 <slack-removing-article-body>. It will also be color coded </basics/service-ticket/settings/state.html#state-colors> according to its latest state.

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.

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.

Then, simply delete the selected code.

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.