How-to: Integrate Slack
Integrate Slack with IBM® UrbanCode® Deploy to post notifications automatically to your Slack app whenever a specific deployment event happens.
Walk through a scenario and learn how to push messages to Slack when an application process fails to deploy in IBM UrbanCode Deploy.
In this example, you'll learn about the requirements and procedure to integrate Slack with IBM UrbanCode Deploy. To integrate Slack with IBM UrbanCode Deploy, follow the steps provided in this section:Step 1: Create an incoming webhook app in Slack
- Go to api.slack.com and click Create an App.
- Provide an App Name and choose an appropriate workspace.
- After you create the app, go to Incoming Webhooks.
- Turn on Activate Incoming Webhooks, and click Add New Webhook to Workspace.
- Choose a Slack channel that you want the post the messages to.
- Click Allow.
- Copy and save the generated webhook URL.
Step 2: Define the message layout
A message layout is defined in a JSON format that includes the message in text, links, and image, if required. For IBM UrbanCode Deploy, you can create message layout that refers to the process name, status, and a link to the process deployment page. This message layout is used in the webhook template. Message layout is defined differently for each event type.
- Application Deployment Failure JSON body
- Application Deployment Success JSON body
- Approval Completed JSON body
- Approval Created JSON body
- Approval Failed JSON body
- External Approval Completed JSON body
- External Approval Failed JSON body
- Generic Process Failure JSON body
- Generic Process Request Started JSON body
- Generic Process Success JSON body
- Process Not Started JSON body
- Process Request Started JSON body
- Task Created JSON body
Step 3: Create a webhook template
Create a webhook template for an application process failure so that when the event happens a notification is triggered in your Slack app.
- Select .
- Provide a name and description for the template. For this example, give the name as Application process failed notification.
- Click on Body and paste the example Application Deployment Failure JSON body from the step 2.
- Choose the event type Process Failure from the Type field.
- Submit your changes.
Step 4: Add the webhook template to an application
You can add a webhook template to applications, generic processes, and external approval processes. For this example, you add the template to an application.
Webhook-Integration-Test | 6/13 6:53 PM |
An approval failed for the App application on the Env environment | |
An application process was rejected during its approval process | |
Application: App Environment: Env Requested by: admin Scheduled for: Sun Jun 13 18:52:31 IST 2021 Description: ${request.Description} | |
Click View Details for more information. |