Introduction

Use the Slack integration to receive ticket updates as Slack messages, acknowledge tickets, and update ticket status and priority.

The following figure shows the outbound interface for sending alert notifications to Slack:

OpsRamp to Slack

The following figure shows the inbound interface, which you can use to create and update incidents for service desk processing:

Slack to OpsRamp

Updates are limited to Slack interactive components

Create a Slack channel

The step to create a Slack channel is optional. If you want to receive event messages in a Slack channel, manually create the channel and use the channel name in the payload.

  1. Log into Slack.
  2. In the Channels navigation panel, click the + icon.
  3. Choose Create a channel.
  4. Enter a channel Name and Description, and set the Make private option to public or private.
  5. Click Create.

Create a Slack application

The Slack application receives incoming webhook and interactive messages.

Configure the application after creating it.

  1. Log into your Slack application.
  2. Navigate to https://api.slack.com/.
  3. Click Create a custom app.
  4. In the Create a Slack App dialog, enter
  • The application name in App Name.
    • The OpsRamp workspace name in Development Slack Workspace.
  1. Click Create App, which takes you to the dialog to configure the application.

Configure the Slack application

  1. In the Features section, click Incoming Webhooks.
  2. Enable the Activate Incoming Webhooks option. This option must be enabled for Slack to display messages from OpsRamp.
  3. Click Add New Webhook to Workspace.
  4. In Where should your app post, enter your channel name.
  5. Click Allow.
  6. Copy and save the webhook URL to use as the base URL when you configure the outbound interface.
  7. Click Interactivity & Shortcuts.
  8. Set the Interactivity option to On.
  9. Click Save Changes.

Create an Incoming Webhook

  1. Log into your Slack application.
  2. In the Apps navigation panel, click the + icon to view the App directory.
  3. Scroll to the application you created.
  4. Click Incoming Webhooks.
  5. Enable the Activate Incoming Webhooks option.
  6. Wait until incoming webhooks indicate enabled.
  7. Click Add New Webhook to Workspace.
  8. In Where should your App post, select your channel name.
  9. Click Allow, which displays the webhook URL.

Example webhook payload

{
 "channel": "demo_channel",
 "attachments": [{
  "fallback": "Incident create notification to slack",
  "color": "#3AA3E3",
  "callback_id": "$incident.id",
  "pretext": "New incident <$utils.ticketAccessURL($incident.id,$incident.client.id,$incident.msp.id,$incident.serviceProviderId)| # $incident.uniqueId> created ",
  "author_name": "By $incident.createdBy.getFullName()",
  "title": "$incident.subject",
  "title_link": "$utils.ticketAccessURL($incident.id,$incident.client.id,$incident.msp.id,$incident.serviceProviderId)",
  "text": "$incident.impact",
  "fields": [{
   "title": "Priority",
   "value": "$incident.priority.name",
   "short": true
  }, {
   "title": "Status",
   "value": "$incident.status.name",
   "short": true
  }],
  "mrkdwn_in": ["pretext"],
  "footer": "OpsRamp",
  "footer_icon": "https://www.opsramp.com/wp-content/uploads/2017/10/OpsRamp_Logo_Color200x.png"
 }, {
  "callback_id": "$incident.id",
  "fallback": "Please modify the priority using below selection",
  "title": "Please modify the priority using below selection",
  "color": "danger",
  "attachment_type": "default",
  "actions": [{
   "name": "priority_list",
   "text": "Change Priority...",
   "type": "select",
   "options": [{
     "text": "Very Low",
     "value": "Very Low"
    },
    {
     "text": "Low",
     "value": "Low"
    },
    {
     "text": "Normal",
     "value": "Normal"
    },
    {
     "text": "High",
     "value": "High"
    },
    {
     "text": "Urgent",
     "value": "Urgent"
    }
   ]
  }]
 }]
}

Slack Integration Installation and Configure

Install the Integration

  1. From All Clients, select a client.
  2. Go to Setup > Account.
  3. Select the Integrations and Apps tab.
  4. The Installed Integrations page, where all the installed applications are displayed.
    Note: If there are no installed applications, it will navigate to the Available Integrations and Apps page.
  5. Click + ADD on the Installed Integrations page. The Available Integrations and Apps page displays all the available applications along with the newly created application with the version.
    Note: You can even search for the application using the search option available. Also you can use the All Categories option to search.
  6. Click ADD in Slack. The Slack Integration page appears.
    Note: Ensure that Adapter addon is enabled at client and partner levels.
  7. Click Install.

Configure inbound operation

Select the Inbound (Slack to OpsRamp) tab.

  1. In the Authentication section, for Authentication Type, choose WEBHOOK and click Save. This generates a token and Webhook URL, which you can copy to use at Slack.

For Webhooks, you must map Incident attributes for the Status and Priority properties.

  1. Expand the Map Attributes section.
  2. For OpsRamp Entity, choose Incident.
  3. For OpsRamp Property, choose Assignee group name or Status.
  4. Click the + icon to add entity information in the Create Incident Mapping on dialog.
  5. Enter the Third-Party Entity and Third-Party Property from the Slack payload.
  6. Choose the parsing condition and enter the Third-Party Property Value to map property value to the OpsRamp property Value.
  7. Expand the ITSM Properties section.
  8. Enter the OpsRamp Entity ID value from the Slack payload and click Save. The ID is the OpsRamp Incident ID key.
  9. Click Save.

Configure outbound operation

Be sure to create a Slack webhook before configuring outbound operation.

  1. Select the Outbound (OpsRamp to Slack) tab.
  2. Expand the Integration Basic Configuration section.
  3. For Notification Type, choose REST API.
  4. For Base URI, enter https://hooks.slack.com/services/T04UETBK6/B0PNKBWR1/GKQPbNkbWR1hgRulOAWYsYG
  5. For Authentication Type, choose NONE.
  6. Click Save.
  7. Expand the Integration Events section and click Add.
  8. Enter an integration event Name.
  9. Choose the entity for which the event is triggered.
  10. Choose Parent Configuration to assign basic integration configuration information to the event.
  11. Choose the HTTP Web Method.
  12. Enter the applicable Headers property name and value. Click the + icon to add additional header properties.
  13. Enter the JSON Payload.
  14. Response: Select a response and enter a value.
    Note:
    • The event is created, only if you provide the response properties.
    • You cannot enter more than four responses.

  15. Click Save.

To add more fields to the payload, click the field name in the Place Holders list.

Custom fields previously defined as a response payload attribute for an integration are not available for configuration in other integrations. To make a custom field available to map on the response payload of another integration, remove the existing mapping from the integration.

Verify integration

  1. Choose the event from the drop-down menu and select the payload type.
  2. Enter the payload and click Verify, which returns a 200- OK response on success.

To receive notifications of integration failures:

  1. Select the Email notification type.
  2. Enter the email address where you want to receive notifications.
  3. Click Save.

Monitoring of Integration

Assign a template from the Monitoring of Integration tab, if you want to monitor integration failures. See monitoring integration failures for more information.

Audit Logs

View logs from the Audit Logs tab. You can view if the event was successful or not.

Event payload examples

To send an event message to a Slack channel, use URL https://hooks.slack.com/services/T04UETBK6/B0PNKBWR1/GKQPbNkbWR1hgRulOAWYsYG and specify the application/json content type in the header.

The following are example payloads for the different events.

Create an Incident Payload

{
 "channel" : "#OpsRamp_incidents",
 "attachments" : [
  {
   "fallback" : "Required plain-text summary of the attachment.",
   "color" : "danger",
   "pretext" : "*New* incident <$esc.java($utils.ticketAccessURL($incident.id,$incident.client.id,$incident.msp.id,$incident.serviceProviderId))| # $esc.java($incident.uniqueId)> created ",
   "author_name" : "By $esc.java($incident.createdBy.getFullName())",
   "title" : "$incident.subject",
   "title_link" : "$utils.ticketAccessURL($incident.id,$incident.client.id,$incident.msp.id,$incident.serviceProviderId)",
   "text" : "$incident.impact",
   "fields" : [
    {
     "title" : "Priority",
     "value" : "$incident.priority.name",
     "short" : false
    }
   ],
   "mrkdwn_in" : [
    "pretext"
   ],
   "footer" : "OpsRamp",
   "footer_icon" : "https://www.opsramp.com/wp-content/themes/twentythirteen/images/OpsRamp-Logo-300x300.png"
  }
 ]
}

Update an Incident Payload

{
 "channel" : "#OpsRamp_incidents",
 "attachments" : [
  {
   "fallback" : "Required plain-text summary of the attachment.",
   "color" : "danger",
   "pretext" : "*New* incident <$esc.java($utils.ticketAccessURL($incident.id,$incident.client.id,$incident.msp.id,$incident.serviceProviderId))| # $esc.java($incident.uniqueId)> created ",
   "author_name" : "By $esc.java($incident.createdBy.getFullName())",
   "title" : "$incident.subject",
   "title_link" : "$utils.ticketAccessURL($incident.id,$incident.client.id,$incident.msp.id,$incident.serviceProviderId)",
   "text" : "$incident.impact",
   "fields" : [
    {
     "title" : "Priority",
     "value" : "$incident.priority.name",
     "short" : false
    }
   ],
   "mrkdwn_in" : [
    "pretext"
   ],
   "footer" : "OpsRamp",
   "footer_icon" : "https://www.opsramp.com/wp-content/themes/twentythirteen/images/OpsRamp-Logo-300x300.png"
  }
 ]
}

Response added Payload

{
 "channel" : "#OpsRamp_incidents",
 "attachments" : [
  {
   "fallback" : "Required plain-text summary of the attachment.",
   "color" : "warning",
   "pretext" : "New response added to incident <$esc.java($utils.ticketAccessURL($incident.id,$incident.client.id,$incident.msp.id,$incident.serviceProviderId))| # $esc.java($incident.uniqueId)>",
   "author_name" : "By $esc.java($incident.latestResponse.creator.getFullName())",
   "title" : "$incident.subject",
   "title_link" : "$utils.ticketAccessURL($incident.id,$incident.client.id,$incident.msp.id,$incident.serviceProviderId)",
   "text" : "$incident.latestResponse.description",
   "fields" : [
    {
     "title" : "Priority",
     "value" : "$incident.priority.name",
     "short" : false
    }
   ],
   "footer" : "OpsRamp",
   "footer_icon" : "https://www.opsramp.com/wp-content/themes/twentythirteen/images/OpsRamp-Logo-300x300.png"
  }
 ]
}

Incident resolved payload

{
 "channel" : "#OpsRamp_incidents",
 "attachments" : [
  {
   "fallback" : "Required plain-text summary of the attachment.",
   "color" : "#7CD197",
   "pretext" : "Incident <$esc.java($utils.ticketAccessURL($incident.id,$incident.client.id,$incident.msp.id,$incident.serviceProviderId))| # $esc.java($incident.uniqueId)> marked asResolved",
   "author_name" : "By $esc.java($incident.statusUpdatedBy.getFullName())",
   "title" : "$incident.subject",
   "title_link" : "$utils.ticketAccessURL($incident.id,$incident.client.id,$incident.msp.id,$incident.serviceProviderId)",
   "mrkdwn_in" : [
    "pretext"
   ],
   "footer" : "OpsRamp",
   "footer_icon" : "https://www.opsramp.com/wp-content/themes/twentythirteen/images/OpsRamp-Logo-300x300.png"
  }
 ]
}

Incident closed payload

{
 "channel" : "#OpsRamp_incidents",
 "attachments" : [
  {
   "fallback" : "Required plain-text summary of the attachment.",
   "color" : "good",
   "pretext" : "Incident <$esc.java($utils.ticketAccessURL($incident.id,$incident.client.id,$incident.msp.id,$incident.serviceProviderId))| # $esc.java($incident.uniqueId)> marked asClosed",
   "author_name" : "By $esc.java($incident.statusUpdatedBy.getFullName())",
   "title" : "$incident.subject",
   "title_link" : "$utils.ticketAccessURL($incident.id,$incident.client.id,$incident.msp.id,$incident.serviceProviderId)",
   "mrkdwn_in" : [
    "pretext"
   ],
   "footer" : "OpsRamp",
   "footer_icon" : "https://www.opsramp.com/wp-content/themes/twentythirteen/images/OpsRamp-Logo-300x300.png"
  }
 ]
}