Creating a Slack connection

A Slack connection allows you and your team to use collaborative ChatOps features for receiving alerts and status. You can only connect to one ChatOps tool at a time, so if you already configured another ChatOps connection (such as Microsoft Teams), you won't be able to connect to Slack.

On the Manage connections tab you can create, edit, and delete connections, whereas on the Schedule connections tab you can manage and view your scheduled connections, and also to 'edit the schedule' of a connection.

Before you set up your Slack connection, you must create your bot and configure Slack to communicate with IBM Cloud Pak for Watson AIOps. For more information about configuring a Slack application, see Configuring Slack applications for connection.

Note: If the URL of the on-premises IBM Cloud Pak for Watson AIOps instance can't be accessed by Slack, you can use Secure Tunnel to expose the IBM Cloud Pak for Watson AIOps instance to either a cluster (Red Hat OpenShift or IBM Kubernetes Service cluster) or a host machine (virtual machine or physical machine), which is accessible from the public network. Then, you can get a URL that can be accessed by Slack. For more information about Secure Tunnel, see Using Secure Tunnel for ChatOps.

For more information about working with a Slack connection, see the following sections:

For more information about HTTP headers for the various credential types, see HTTP headers for credential types.

Creating a Slack connection

To complete your Slack connection, you need the following information:

Obtaining these values require you to have the following prerequisites:

  • Slack

  • API authentication to your Slack instance

  • If you have an online deployment of IBM Cloud Pak for Watson AIOps, network connectivity between the IBM Cloud Pak for Watson AIOps instance and the Slack Enterprise edition instance

    Note: If a direct endpoint cannot be established, you can use Secure Tunnel to securely tunnel between the two. For more information about Secure Tunnel, see Using Secure Tunnel for ChatOps.

Important: You can only create one ChatOps connection (Microsoft Teams or Slack) per instance.

For more information about setting up and configuring Slack for connection, see Configuring Slack for connection.

To create a Slack connection, complete the following steps:

  1. Log in to IBM Cloud Pak Automation console.

  2. Expand the navigation menu (four horizontal bars), then click Define > Data and tool connections.

  3. On the Data and tool connections page, click Add connection.

  4. From the list of available connections, find and click the Slack tile.

    Note: If you do not immediately see the connection that you want to create, you can filter the tiles by type of connection. Click the type of connection that you want in the Category section.

  5. On the side-panel, review the instructions and when ready to continue, click Connect.

  6. On the Add connection page, define the general connection details:

    • Name: The display name of your connection. If you have any restrictive EgressNetworkPolicies in place, ensure that they are updated to allow for this outbound connection.
    • Description: An optional description for the connection.
    • Signing secret: The secret that is generated for the client. You can copy this value from the App Credentials section inside the Basic Information page of the Slack application. For more information about obtaining this value, see Configuring your Slack app. If you edit this field, the secret for the current connection is updated. Leave this field blank if you do not want to update the secret.
    • Language ID: A dropdown list offering various different languages options for the connection.
    • Bot token: Token for the bot that is associated with the app that is installed in a workspace. You can copy this value from the Install App section in the Slack application. For more information about obtaining this value, see Configuring your Slack app. If you edit this field, the secret for the current connection is updated. Leave this field blank if you do not want to update the secret.
    • Proactive channel: Enter a proactive channel for the connection. The channel ID for the channel that you want to use for notifications (from change risk, for example). For more information about obtaining channel ID values, see Obtaining links to your channels.
    • Reactive channel: Enter a reactive channel for the connection. The channel ID for the channel that you want to use for stories and alerts. For more information about obtaining channel ID values, see Obtaining links to your channels.

    On the optional Configure Proxy page, toggle the Enable Proxy selection to on if you require a proxy server to connect to Slack, and enter the following information:

    • Proxy URL: The hostname of your proxy server
    • Proxy Port: The port number
    • Proxy username: The proxy server username
    • Proxy password: The proxy server password

    You can test your connection by clicking Test connection to Slack.com.

  7. Click Done.

You create a Slack connection in your instance. Unlike log or event connection, you do not need to enable ChatOps connections after creating them.

To create more connections, see Configuring data and tool connections.

For more information about working with the insights provided by your connection, see ChatOps insight management.

Editing a Slack connection

After you create your connection, your can edit the connection. For example, if you want to change which channel your proactive messages are routed to, you can edit it. To edit a connection, complete the following steps:

  1. Log in to IBM Cloud Pak Automation console.

  2. Expand the navigation menu (four horizontal bars), then click Define > Data and tool connections.

  3. Click the Slack connection type on the Manage connections tab of the Data and tool connections page.

  4. On the Slack connections page, click the name of the connection that you want to edit. Alternatively, you can click the options menu (three vertical dots) for the connection and click Edit. The connection configuration opens.

    Note: The connections status in the Manage connections tab might not display the status of your Slack connection. When you are editing a Slack connection, click the Test connection button to ensure that your credentials are correct.

    You can test your connection by clicking Test connection. You can also test your connection by going to the target channel in Slack and entering /welcome. IBM Cloud Pak for Watson AIOps responds with a welcome message in Slack.

  5. Edit your connection. Click Next to go through the connection configurationn pages. Click Save when you are done editing.

Notes:

  • When a ChatOps connection is updated, a failure in the caching mechanism causes the old app credentials to be used rather than the new credentials. To use the updated credentials, restart the chatops-integrator pod. Once the pod is running again, the updated Slack credentials are used. If the errors continue, check that the Slack application is a channel member of the channel ID that was input into the ChatOps connection form. For more information, see Updated ChatOps connection fails.
  • Updating a ChatOps connection with a new Slack app can result in disconnected ChatOps stories. Existing stories that were posted by a different app do not receive any more updates. You are recommended to use the same app resource when possible.

Your connection is now edited. For more information about deleting a connection, see Deleting a Slack connection.

Deleting a Slack connection

If you no longer need your Slack connection, you can delete the connection from the console.

To delete a connection, complete the following steps:

  1. Log in to IBM Cloud Pak Automation console.

  2. Expand the navigation menu (four horizontal bars), then click Define > Data and tool connections.

  3. Click the Slack connection type on the Manage connections tab of the Data and tool connections page.

  4. On the Slack connections page, click the options menu (three vertical dots) for the connection that you want to delete and click Delete.

  5. Enter the name of the connection to confirm that you want to delete your connection. Then, click Delete.

Your connection is deleted.