Introduction
This document shows an example of what needs to be done on Slack to make it integration-ready with an endpoint in your ONEiO subscription. Note also that the number of fields used in integrations might vary.
For any questions related to setting up the integration, please send mail to support@oneio.cloud.
You can sign up for a free trial of ONEiO from the following link: ONEiO Free Trial
Overview
This article gives an overview of the required steps to integrate ONEiO and Slack. In this guide, we cover the following steps required for communication between ONEiO and Slack (one direction).
Info
If you want to add Slack Modal capabilities to your Slack endpoint and bi-direction communication, please refer to this article: How to add slash commands (Modal) to your Slack Endpoint
Creating your Slack App
Let's start creating a Slack app. The following steps show how to setup a basic Slack app and adjust its settings. After successfully creating your Slack app, we can continue to create and configure your ONEiO's Slack endpoint.
Log in to your Slack account (https://api.slack.com) with your account administrator user and select Your Apps from the top right corner of your screen.
Start by clicking on Create New App and select From Scratch
Write the app name and select the workspace for the App
Fill out the basic information/ display information
Configuring Slack App scopes
Select OAuth & Permissions from the left menu, and then go to Scopes.
Add the scope chat:write.
To activate your app in Slack, Install to Workspace.
On the next page, click on "allow".
Note: As soon as you install your app into the channel you decided on, an Incoming Webhooks is created for the selected channel.
Adding your App to a channel
Go to the channel on which you want to install the application and navigate to View channel details
Navigate to Integrations and Add an app
Fin your app (you can use the search box) and click on Add
Upon adding your app, this pop-up window will automatically close and a confirmation message will be displayed in the Slack channel where you added the app
Your Slack app setup is complete.
Sending messages from ONEiO to Slack
Creating your Slack endpoint
Now let's create your Slack endpoint.
Access your ONEiO subscription, go to Endpoints, and select New endpoint
Choose the Slack endpoint and click on Create
- Enter your endpoint name
- Select your timezone
- Insert any value on Bot User OAuth Token. This field will be updated in the next steps
- Then, click on create
For more details, you can check Endpoint Configuration Guide - Slack
Configuring your Slack Endpoint
Edit your Slack App and go to Features -> OAuth & Permissions.
Copy the Bot User OAuth Token. We will use it in the next step.
Now, go to ONEiO App and edit your Slack endpoint.
Insert your copied token as Bearer xoxb-*** on Bot User OAuth Token.
Save your endpoint and the endpoint configuration is complete.
Configuring Routing Rules
The last step is creating a routing rule to send data from any integration to your Slack Endpoint.
In this example, we will show how to send data from Jira to Slack.
In ONEiO app, go to Routing Rules and create a new rule.
Fill your rule name and set the Route information as shown below, just replacing the inbound endpoint with your own integrated endpoint.
Set the outbound endpoint as Slack, Entity Type as view_submission, and Message Type as Message.
- Rule name: Jira -> Slack: Issue Created (you can name your rule freely)
- Route information -> Inbound: Select your connected endpoint (ex: Jira) and set the Entity Type (ex: Incident)
- Route information -> Outbound: Select the endpoint Slack, Entity Type view_submission and Message Type: Message
- Operation: Apply for CREATE messages
Go to Mappings, and in Outbound mappings we will add the mapping from your endpoint to Slack.
In this example, Slack will receive the channel id and the message text.
Source value | Outbound attribute |
[your channel id] | channel |
*A new issue was created:*#${issue.key}: ${issue.fields.summary} | text |
You can retrieve the channel id in your Slack app. Right-click in the channel you installed your app,
select view channel details and at the very bottom you can find the channel id:
Save your rule and you are ready to send data from your endpoint to Slack. Just send an event and you should receive a Slack message with the event content.
In this example, I'll send an incident from Jira:
And receive it in the Slack channel:
Congratulations!
Your Slack integration is complete.
Comments
Please sign in to leave a comment.