ServiceNow - Slack Integration

Sumanth Reddy K
Tera Contributor

Hi Everyone!

 

Let's understand how we can integrate ServiceNow with Slack using existing Slack Webhooks spoke and post messages over Slack channel.

 

Spoiler
NOTE: Sharing this for absolute beginners who have little/No knowledge on Integrations. Experienced folks may ignore this or provide your inputs regarding what more complex can be achieved 😊

Firstly, let's try to understand what Incoming webhooks are:

Incoming Webhooks are a simple way to post messages from external sources into Slack. They make use of normal HTTP requests. The Slack Webhooks Spoke uses webhooks to enable simple integrations to:

  • Post a Message
  • Post Change details
  • Post Incident details
  • Post Problem details

Step - 1: Create a Slack Workspace

  1. Navigate to https://slack.com/ and log-in with your account. If you don’t have one, create one.

  2. Click the "Create a Workspace" button.

  3. Fill out the basic details:

    1. Input Workspace name and hit Next

    2. Following, Input basic info about you such as Name etc., and click Next

    3. Next you can invite your team to the workspace (you can skip this step)

    4. Next, Input what’s your team working on - e.g., Integrations

    5. Final step, when asked to chose subscription, select Free (Start with Free) and you are good to go!

  4. You can use any of the pre-defined channels say #random or can create a new channel, e.g., #incidents

Step - 2: Setup Incoming Webhooks

  1. Navigate to Sending messages using incoming webhooks | Slack (Make sure you’re already logged-in to your slack workspace in browser)

  2. Click “Create your Slack App”

    1. choose “From an app manifest” for now. (If you have some knowledge on slack configurations and want to build your own app from scratch, you can choose “From scratch”)

    2. Select your workspace that was created previously and click Next.

    3. You can continue with default name or you can change your app name in the app manifest

    4. Click Next and then Create in step 3. Hurray! you’ve created your app.

    5. You’ll be re-directed to app configuration page with basic information and configurations. You can see all the relevant details about your app such as App credentials, tokens, Display Information etc.

  3. Click on Incoming Webhooks on the App Home page

  4. Toggle ON Activate Incoming webhooks

  5. Scroll down and select Add New Webhook to Workspace

  6. Next you need to select a channel where your app needs to post. You can go with already defined channels such as #general or #random OR you can create a new channel for posting incident related messages. for now, we’ll go ahead and select #random channel and click Allow

  7. You’ll be re-directed to Incoming webhooks feature in App Homepage. Scroll down and you can find Webhook URL.

  8. Copy this URL and note it down as this will be used in our flow in coming stages.

  9. We are done with Slack configurations. Next is to create a flow and use Slack Webhook Spoke to post messages in the #random channel

Step - 3: Create a flow in ServiceNow

  1. Navigate to All > Flow Designer in ServiceNow

  2. Click on New > Flow and give name to your flow

  3. In the trigger conditions, add below trigger as shown in the image

    Flow Trigger ConditionFlow Trigger Condition

    NOTE: Here, we are taking the scenario when a P1 or P2 incident is created in the ServiceNow, message has to be posted in the slack channel. You are free to use whichever scenario you want to use/test 👍

  4. Next, click Done and then Select Add an action

    1. Select Post a Message Webhook action from Slack Webhooks pre-installed spoke

    2. If you cannot find this spoke, make sure you activate ServiceNow Integration Hub Installer plugin from developer site.

  5. Next configure the action as shown in below action and you are done.

    Flow ActionFlow Action

  6. Feel free to customize the Message. You can also try complex messaging like providing link to the incident etc., I have covered only basic thing here.

  7. Save and Activate your flow and test with any incident record. You’ll see the incident message in the channel you have defined over slack.

Messages posted in slack channelMessages posted in slack channel

That’s it, You have successfully integrated ServiceNow with Slack messaging App!!

 

NOTE: Feel free to modify the trigger conditions and message details and play around with it. Happy Learning!!

Also, attaching pdf file with all the relevant images related to each step for better understanding! feel free to refer 🙂 and correct me if any mistakes are there 🙂

 

Regards
Sumanth Reddy K
2 REPLIES 2

JeffZ
Kilo Contributor

Are you aware of a way to alter the form when creating an incident from Slack to ServiceNow? I can't seem to locate documentation for that or if it's possible.

DanielBr
Tera Contributor

Do you know if there will be additional costs due to this integration with Slack or can you just use it for free?