Integrations

ServiceNow Slack Integration Guide

intermediateOAuth 2.0 Bearer Token AuthenticationSlack

The ServiceNow Slack integration enables real-time collaboration by connecting your ITSM processes with Slack channels and direct messages. This integration solves the critical business problem of delayed incident response and poor stakeholder communication by bringing ServiceNow updates directly into the conversation spaces where teams already work. IT operations teams, service desk agents, and business stakeholders use this integration to stay informed without constantly checking ServiceNow. The integration supports bidirectional data flows - ServiceNow can send automated notifications to Slack channels when incidents are created or updated, while Slack users can interact with ServiceNow records through slash commands and interactive messages. The primary automation pattern uses IntegrationHub flows triggered by business rules or schedule, with the integration living in the Flow Designer and Integration Hub modules within ServiceNow.

Prerequisites

  • ServiceNow Paris release or later with Integration Hub Professional license
  • Slack workspace administrator privileges to create and manage apps
  • ServiceNow admin role or equivalent permissions to configure Integration Hub spokes
  • Flow Designer role to create and modify integration flows
  • Valid SSL certificate on your ServiceNow instance for webhook callbacks
  • Network connectivity allowing outbound HTTPS traffic to Slack APIs
  • Slack for ServiceNow spoke installed from ServiceNow Store (com.servicenow.slack)

Architecture Overview

The ServiceNow Slack integration uses the official Slack for ServiceNow Integration Hub spoke, which provides pre-built actions for common Slack operations like sending messages, creating channels, and handling slash commands. Authentication is established through OAuth 2.0 with Slack API tokens stored securely in ServiceNow Connection & Credential Alias records, ensuring credentials are encrypted and centrally managed. Data flows bidirectionally - outbound flows send notifications from ServiceNow to Slack triggered by business rules or scheduled jobs, while inbound flows process Slack slash commands and interactive button clicks through Scripted REST APIs that receive webhook payloads. No MID Server is required since all communication occurs over HTTPS directly between ServiceNow and Slack's cloud APIs, but proper firewall configuration must allow outbound connections to slack.com domains. Rate limiting follows Slack's standard API limits of approximately 1 request per second per workspace, with the spoke automatically handling retry logic for rate-limited requests.

Sourdough
Chrome Extension

Sourdough: ServiceNow Monitoring and Analytics

A Chrome extension for ServiceNow Admins and Developers with essential tools, analytics, graphs and monitoring features.

Instance HealthGraphs & ChartsAPI HealthDeveloper ToolsQuick SearchInstance Switcher
Add to Chrome

Free to install. Pro $5/month after a 14-day no-card trial.
Pro requires the ServiceNow admin role. Upgrade inside the extension.

Overview
Tasks
CMDB
API
Metrics
Monitor
Internals
Instance:sourdoughdev·Version:Yokohama
Instance StateONLINE
System StatusFully Operational
Session Timeout90 minutes
Logged-In Sessions2 (20 active)
Build Nameyokohama-12-18-2024_p1
IP Address10.159.128.43
Instance HealthHealth Score: 90%
🔥 5dSourdough (Chrome Plugin)Dark Mode

Implementation Steps

1

Install and activate the Slack spoke from ServiceNow Store

Navigate to System Applications > All Available Applications > All and search for 'Slack for ServiceNow' in the ServiceNow Store. Click Install on the official ServiceNow-published spoke (com.servicenow.slack) and wait for the installation to complete, which typically takes 2-3 minutes. After installation, navigate to System Applications > My Company Applications and verify the Slack spoke appears with Active status. If the spoke shows as Inactive, click the application name and select Activate to enable all the spoke actions and connection templates.

2

Create a Slack app and obtain API tokens

Log into your Slack workspace as an administrator and navigate to api.slack.com/apps to create a new Slack app. Click 'Create New App', choose 'From scratch', provide an app name like 'ServiceNow Integration', and select your target workspace. In the app settings, navigate to OAuth & Permissions and add the following bot token scopes: chat:write, channels:read, users:read, and commands. Install the app to your workspace by clicking 'Install App to Workspace' and copy both the Bot User OAuth Token (starts with xoxb-) and the Signing Secret from the Basic Information page.

3

Configure Slack credentials in ServiceNow Connection & Credential Alias

Navigate to Connections & Credentials > Credentials in ServiceNow and create a new Basic Auth credential record with Name 'Slack Bot Token' and User name set to 'token'. Paste your Slack Bot User OAuth Token in the Password field and save the record. Next, navigate to Connections & Credentials > Connection & Credential Aliases and create a new alias with Name 'Slack Default' and Type 'Credential'. Select your newly created credential in the Credential field and set the Connection URL to 'https://slack.com/api' to establish the base endpoint for all Slack API calls.

ServiceNow Script
// Test the credential configuration
var r = new sn_ws.RESTMessageV2();
r.setEndpoint('https://slack.com/api/auth.test');
r.setHttpMethod('POST');
r.setRequestHeader('Authorization', 'Bearer ' + gs.getProperty('slack.bot.token'));
var response = r.execute();
gs.info('Slack auth test response: ' + response.getBody());
4

Create a Flow Designer flow for incident notifications

Navigate to Process Automation > Flow Designer and create a new flow with name 'Slack Incident Notifications' and trigger 'Record Updated'. Set the table to 'Incident [incident]' and add conditions to trigger when State changes to High Impact incidents. Add a new action by searching for 'Slack' in the Action Library and select 'Post Message to Channel' from the Slack spoke. Configure the action by selecting your Slack Default connection alias, setting the channel to your desired incident channel name (like #incidents), and using flow variables to build a meaningful message template with incident number, short description, and priority.

ServiceNow Script
// Flow Designer message template for Slack action
"🚨 *Incident Created*\n" +
"*Number:* " + trigger.incident.number +
"\n*Description:* " + trigger.incident.short_description +
"\n*Priority:* " + trigger.incident.priority.getDisplayValue() +
"\n*Assigned to:* " + trigger.incident.assigned_to.getDisplayValue() +
"\n*Link:* " + gs.getProperty('glide.servlet.uri') + 'incident.do?sys_id=' + trigger.incident.sys_id
5

Configure Slack slash commands for ServiceNow queries

Return to your Slack app configuration at api.slack.com/apps and navigate to Slash Commands to create a new command like '/snow-incident'. Set the Request URL to your ServiceNow instance REST endpoint (https://yourinstance.servicenow.com/api/x_snc_slack/slack_endpoint) and add a description like 'Query ServiceNow incidents'. In ServiceNow, navigate to System Web Services > Scripted REST APIs and locate the auto-generated Slack endpoint resource. Modify the script to handle your slash command by parsing the command text, querying the incident table based on parameters, and returning formatted results to Slack using the response JSON structure expected by Slack's slash command format.

ServiceNow Script
(function process(request, response) {
    var slackPayload = JSON.parse(request.body.data);
    var commandText = slackPayload.text;
    var incidentGR = new GlideRecord('incident');
    incidentGR.addQuery('number', 'CONTAINS', commandText);
    incidentGR.setLimit(5);
    incidentGR.query();
    
    var responseText = 'Found incidents:\n';
    while (incidentGR.next()) {
        responseText += incidentGR.getDisplayValue('number') + ' - ' + incidentGR.getDisplayValue('short_description') + '\n';
    }
    
    var slackResponse = {
        'response_type': 'in_channel',
        'text': responseText
    };
    
    response.setBody(slackResponse);
})(request, response);
6

Set up interactive Slack buttons for incident actions

Enhance your incident notification flow by adding interactive buttons that allow Slack users to acknowledge or assign incidents directly from the message. In Flow Designer, modify your incident notification action to include an attachments array with action buttons using Slack's interactive components format. Configure button callbacks to POST back to a dedicated ServiceNow REST endpoint that processes the action and updates the incident record. Create a new Scripted REST API resource to handle these interactive callbacks, parsing the Slack payload to identify which button was clicked and which incident to update, then performing the corresponding ServiceNow record update.

ServiceNow Script
// Interactive button configuration in Flow Designer
{
  "text": "Incident " + trigger.incident.number,
  "attachments": [{
    "text": trigger.incident.short_description,
    "fallback": "Unable to display incident actions",
    "callback_id": "incident_" + trigger.incident.sys_id,
    "actions": [{
      "name": "acknowledge",
      "text": "Acknowledge",
      "type": "button",
      "value": "acknowledge",
      "style": "primary"
    }, {
      "name": "assign",
      "text": "Assign to Me",
      "type": "button",
      "value": "assign"
    }]
  }]
}
7

Configure webhook validation and security

Navigate to your Slack app's Basic Information page and copy the Signing Secret to implement proper webhook validation in ServiceNow. In your Scripted REST API endpoints, add validation logic to verify that incoming requests are actually from Slack by computing the HMAC SHA256 signature of the request body using your signing secret. Create a Script Include to handle this validation logic consistently across all your Slack endpoints, checking both the timestamp freshness (within 5 minutes) and the signature match. This prevents unauthorized parties from sending malicious payloads to your ServiceNow integration endpoints and ensures compliance with Slack's security requirements.

ServiceNow Script
// Script Include for Slack webhook validation
validateSlackSignature: function(requestBody, timestamp, slackSignature) {
    var signingSecret = gs.getProperty('slack.signing.secret');
    var baseString = 'v0:' + timestamp + ':' + requestBody;
    var hmac = new GlideCryptoJS.HmacSHA256(baseString, signingSecret);
    var computedSignature = 'v0=' + hmac.toString();
    
    // Check timestamp is within 5 minutes
    var currentTime = Math.floor(Date.now() / 1000);
    if (Math.abs(currentTime - parseInt(timestamp)) > 300) {
        return false;
    }
    
    return computedSignature === slackSignature;
}
8

Test the integration and configure error handling

Create a test incident in ServiceNow to verify your notification flow triggers correctly and sends a properly formatted message to your designated Slack channel. Test your slash command by typing '/snow-incident INC0000123' in Slack to ensure it queries ServiceNow and returns incident details. Verify interactive buttons work by clicking them and confirming the incident record updates in ServiceNow. Add comprehensive error handling to your flows and REST APIs by implementing try-catch blocks, logging errors to the ServiceNow system log, and sending fallback messages to Slack when operations fail. Set up monitoring by creating scheduled flows that periodically test the Slack connection and alert administrators if the integration becomes unavailable.

ServiceNow Script
// Error handling in Slack REST API
try {
    var incidentGR = new GlideRecord('incident');
    if (incidentGR.get(incidentSysId)) {
        incidentGR.setValue('state', '2'); // In Progress
        incidentGR.setValue('assigned_to', slackUserId);
        incidentGR.update();
        
        return {
            'text': 'Incident ' + incidentGR.getDisplayValue('number') + ' has been assigned to you.'
        };
    }
} catch (ex) {
    gs.error('Slack integration error: ' + ex.getMessage());
    return {
        'text': 'Sorry, there was an error processing your request. Please try again or contact your administrator.',
        'response_type': 'ephemeral'
    };
}

Common Use Cases

Real-time incident notifications to operations channels

Automatically notify Slack channels when high-priority incidents are created or escalated in ServiceNow. This use case triggers on incident state changes or priority updates, sending formatted messages with incident details, assignment information, and direct links to the ServiceNow record. The integration posts to dedicated channels like #critical-incidents or #operations, ensuring the right teams are immediately aware of issues. Business value includes faster response times, improved stakeholder awareness, and reduced time to resolution through better communication.

Service request approvals via Slack interactive messages

Send service request approval notifications to managers' direct messages or approval channels with interactive Approve/Reject buttons. When a service request requires approval, the integration creates a Slack message containing request details, requester information, and business justification. Approvers can click buttons directly in Slack to approve or reject requests, with the action immediately updating the ServiceNow workflow and notifying relevant parties. This streamlines the approval process by meeting approvers where they work and eliminating the need to log into ServiceNow for routine approvals.

Knowledge base search through slash commands

Enable Slack users to search ServiceNow's knowledge base without leaving their conversation using custom slash commands like '/kb search network troubleshooting'. The integration queries the kb_knowledge table based on the search terms, ranks results by relevance, and returns formatted snippets with links to full articles. Users can quickly access institutional knowledge during troubleshooting or customer support conversations, improving first-call resolution rates. This use case is particularly valuable for support teams who need immediate access to documentation while actively helping customers.

Change advisory board notifications and voting

Automatically notify Change Advisory Board members in dedicated Slack channels when emergency changes are proposed or when standard changes deviate from approved templates. The integration sends change details including risk assessment, implementation plan, and rollback procedures with interactive voting buttons for CAB members. Vote tallies are tracked in ServiceNow and change records are automatically updated based on voting outcomes. This enables faster change approval cycles while maintaining proper governance and audit trails for compliance requirements.

Performance dashboard alerts for service degradation

Monitor ServiceNow performance analytics and business service health dashboards, automatically posting alerts to relevant Slack channels when KPIs fall below thresholds. The integration triggers when metrics like average resolution time, customer satisfaction scores, or service availability drop below defined levels. Messages include trend analysis, affected services, and recommended actions with links to detailed reports and dashboards. Operations and management teams receive proactive notifications about service degradation before it impacts customers, enabling preventive action and continuous service improvement.

Troubleshooting

Slack messages not appearing despite successful flow execution logs

Check the Integration Hub execution details for the specific Slack action and look for HTTP response codes in the step results. Navigate to System Logs > Outbound HTTP Requests and filter by your Slack endpoint to see the actual API response from Slack, which often contains specific error messages about invalid channels, missing permissions, or malformed message content. Verify your bot token has the necessary scopes (chat:write, channels:read) and that the bot has been added to the target channel. Common issues include trying to post to private channels where the bot isn't a member or using channel names without the # prefix.

Slash commands returning 'application_error' or timeout messages

Slack requires slash command endpoints to respond within 3 seconds, so optimize your ServiceNow script performance by adding appropriate GlideRecord query limits and indexes. Check the Application Log for your Scripted REST API to identify slow database queries or infinite loops in your command processing logic. Implement asynchronous processing for complex operations by immediately returning an acknowledgment message to Slack, then using delayed response URLs to post results when processing completes. Verify your REST API resource is accessible externally by testing the endpoint URL directly from a browser or REST client.

Interactive button clicks not updating ServiceNow records

Verify webhook signature validation is implemented correctly in your interactive message handler, as Slack will retry failed webhook deliveries which can cause duplicate processing. Check that your button callback_id values are properly parsed to extract the record sys_id and that the user clicking has sufficient ServiceNow permissions to update the target record. Navigate to System Logs > Application Logs and filter by your REST API name to see detailed error messages about permission failures or invalid record states. Ensure your interactive message handler returns proper JSON responses with confirmation messages, as Slack expects specific response formats for button interactions.

OAuth token authentication failures with 401 Unauthorized responses

Regenerate your Slack app's Bot User OAuth Token from the OAuth & Permissions page and update the credential record in ServiceNow, as tokens can expire or be revoked if the app configuration changes. Verify the token format starts with 'xoxb-' and check that your Connection & Credential Alias is properly configured with the correct credential reference. Test the token directly using Slack's auth.test API endpoint through a REST Message to confirm the token is valid and has the required permissions. Common causes include app reinstallation without updating ServiceNow credentials or workspace security policies that automatically revoke tokens.

Flow Designer flows triggering multiple times for single record updates

Add proper condition logic to your flow triggers to prevent cascading updates when the flow itself modifies records that could retrigger the same flow. Use the 'Trigger Conditions' section to specify exact field changes rather than general record updates, and consider using 'Changed' operators instead of 'Is' operators for state fields. Implement flow execution guards by checking if updates are coming from automated sources using conditions like 'Updated by does not contain System' or by setting specific update flags. Review the Flow Execution History to identify the exact trigger patterns and adjust your conditions to be more specific about when the flow should execute.

Large message payloads causing Slack API rate limiting or message truncation

Implement message chunking for large content by breaking long incident lists or knowledge base results into multiple smaller messages posted with appropriate delays. Use Slack's thread feature to organize related messages under a parent message rather than flooding channels with multiple top-level posts. Monitor your integration's API usage patterns and implement exponential backoff retry logic when Slack returns 429 rate limit responses, using the Retry-After header to determine appropriate wait times. Consider using Slack's file upload API for large data sets or complex formatting instead of trying to fit everything into message text, and always include message truncation indicators when content exceeds Slack's limits.

Pro Tips

  • Configure separate Slack apps for different ServiceNow environments (dev, test, prod) to prevent cross-environment message pollution and ensure proper testing isolation. Use environment-specific channel naming conventions and maintain separate credential sets to avoid accidentally sending test data to production channels.
  • Implement message threading for related updates by storing Slack message timestamps in ServiceNow records and using the thread_ts parameter in subsequent API calls. This keeps conversations organized and prevents channel flooding while maintaining context for ongoing incidents or requests.
  • Use Slack's scheduled message feature through the chat.scheduleMessage API to respect team working hours when sending non-critical notifications. Store user timezone preferences in ServiceNow and calculate appropriate delivery times to improve message relevance and reduce after-hours noise.
  • Create reusable message templates using ServiceNow's UI Macros or custom tables to maintain consistent formatting across different integration points. This approach ensures branding consistency, reduces maintenance overhead, and makes it easier to update message formats globally when requirements change.
  • Leverage Slack's user group mentions (@channel, @here, or custom groups) strategically by mapping ServiceNow assignment groups to Slack user groups in a custom mapping table. This enables dynamic notifications that automatically mention the right people based on ServiceNow assignment logic.
  • Implement comprehensive audit logging by creating custom tables to track all Slack interactions, message deliveries, and user actions for compliance and troubleshooting purposes. Include fields for Slack message IDs, delivery status, user responses, and timestamps to maintain full traceability of integration activities.

Known Limitations

  • Slack API rate limits restrict apps to approximately 1 request per second per workspace, which can cause delays during high-volume incident periods or bulk notification scenarios. The Integration Hub spoke includes retry logic, but complex flows with multiple Slack actions may experience significant delays during peak usage periods.
  • Message formatting is limited to Slack's supported markdown subset and interactive component constraints, preventing rich HTML formatting or complex layouts available in ServiceNow forms. Large data sets or detailed technical information may require alternative presentation methods like file attachments or shortened summaries with links to full ServiceNow records.
  • Bi-directional user mapping between Slack and ServiceNow requires manual configuration and maintenance, as there's no automatic synchronization of user accounts between systems. Organizations must implement custom logic to map Slack user IDs to ServiceNow user records, and this mapping can break when users change email addresses or leave the organization.
  • The integration requires an Integration Hub Professional license for production use, and flow execution limits may restrict the number of concurrent Slack operations during high-activity periods. Organizations with large incident volumes may need to implement queuing mechanisms or prioritize certain notification types to stay within license limits.
  • Webhook delivery reliability depends on network connectivity and ServiceNow instance availability, with no built-in mechanism for handling failed deliveries during maintenance windows. Slack will retry failed webhook deliveries for up to 3 days, but there's no guarantee of message order preservation or delivery confirmation for critical notifications.

Frequently Asked Questions

Can I customize which ServiceNow fields appear in Slack notifications without modifying the core Integration Hub spoke?

Yes, you can customize message content entirely within Flow Designer without touching the spoke code by building dynamic message templates using flow variables and script steps. Create a script step before your Slack action that constructs your message string using any ServiceNow record fields, calculated values, or related record data you need. The spoke's 'Post Message' action accepts any text content you provide, so you have complete control over formatting and field selection. You can also use ServiceNow's GlideTemplate API within script steps to create reusable message templates that pull data from multiple tables and apply conditional formatting based on record values.

How do I handle ServiceNow user authentication when processing Slack slash commands from users who aren't logged into ServiceNow?

Implement a user mapping system by creating a custom table that links Slack user IDs to ServiceNow user sys_ids, then configure your slash command handlers to impersonate the mapped ServiceNow user using GlideSystem.setUserSession() or run queries with elevated privileges using admin credentials. For security, validate that mapped users have appropriate permissions for the requested operations and consider implementing approval workflows for sensitive actions. Alternatively, you can create a dedicated ServiceNow integration user with read-only permissions for information queries and require users to authenticate through ServiceNow's OAuth provider for actions that modify data. The Slack spoke includes helper methods for extracting and validating Slack user information from webhook payloads.

What's the best approach for handling Slack workspace migrations or app reinstallations without breaking the ServiceNow integration?

Design your integration with externalized configuration by storing Slack app credentials, channel mappings, and workspace-specific settings in custom ServiceNow tables rather than hardcoding values in flows or scripts. Create a configuration management interface that allows administrators to update Slack app tokens, channel lists, and user mappings without modifying integration logic. Document your app's required permissions and configuration steps in ServiceNow's Knowledge Base so team members can quickly reconfigure after migrations. Consider implementing health check flows that periodically test the Slack connection and automatically alert administrators when credentials need updating, and always maintain backup exports of your Flow Designer flows and REST API configurations.

Can I use the Slack integration to send notifications about custom ServiceNow applications and tables beyond standard ITSM records?

Absolutely, the Slack Integration Hub spoke works with any ServiceNow table or custom application since it simply sends HTTP requests to Slack's APIs regardless of the data source. Create Flow Designer flows triggered by your custom tables using the same patterns as incident notifications, and build custom Scripted REST APIs to handle slash commands that query your application data. You can extend the integration to custom scoped applications by installing the Slack spoke as a dependency and using cross-scope privileges to access spoke actions from your application flows. The key is designing your message templates and user interactions around your custom data model while leveraging the spoke's core communication capabilities for reliable message delivery and interactive components.

How do I implement proper error handling and retry logic for failed Slack API calls in high-availability environments?

The Integration Hub spoke includes built-in retry logic for transient failures, but you should supplement this with custom error handling in your flows using conditional branches that check action outcomes and implement business-specific fallback behaviors. Create a custom error logging table to track failed Slack operations with details about the intended recipient, message content, and failure reason, then build scheduled flows that retry failed operations during off-peak hours. For critical notifications, implement multiple delivery channels by adding email or SMS backup actions when Slack delivery fails. Use Flow Designer's error handling capabilities to catch exceptions and either retry immediately, schedule delayed retries, or route failures to human operators for manual resolution depending on the message priority and business impact.

What security considerations should I implement when exposing ServiceNow data through Slack channels that may include external contractors or vendors?

Implement data classification policies by creating custom fields on your ServiceNow tables to mark sensitive records and configure your notification flows to filter out classified data before sending to Slack channels with external members. Use Slack's private channels and user group restrictions to limit access to sensitive integrations, and implement approval workflows for adding external users to channels that receive ServiceNow notifications. Consider creating separate integration flows for external-facing channels that provide limited information with links back to ServiceNow for full details, ensuring external users only see data they're authorized to access. Additionally, implement audit logging for all Slack interactions to track which external users accessed what information and configure data retention policies to automatically purge sensitive messages from Slack channels after defined periods.

How can I monitor and measure the performance and adoption of my ServiceNow Slack integration across the organization?

Create custom reporting tables to track integration usage metrics including message delivery rates, user interactions with slash commands, response times for interactive actions, and correlation between Slack notifications and ServiceNow record resolution times. Build ServiceNow dashboards that display integration health metrics, popular commands, most active channels, and user adoption rates across different teams and departments. Use Flow Designer's execution history and Performance Analytics to monitor flow performance and identify bottlenecks or frequently failing operations. Implement custom business rules that track when users access ServiceNow records directly from Slack links to measure the integration's effectiveness in driving user engagement with the platform and reducing support ticket escalations.

Test Your Knowledge

Quick 3-question quiz — see how your ServiceNow skills stack up.

Question 1 of 3Performance

A list view on a table with millions of records is slow. Best fix?

Select an answer to continue