Integrating with PagerDuty
This integration opens a new incident when a customer talks in a specific Slack channel, acknowledges the incident when a member of your team joins the conversation, and closes the incident when you close the frame.
Heads Up!
This integration relies on Frame running in the Slack channel in Active Mode, which will automatically open a new frame when a customer speaks, then keep the frame open until the agent closes it with
/frame close
.
For PagerDuty, you'll want to create three separate Zaps corresponding to the three phases of an incident: create, acknowledge, resolve. Each Zap will start with the same two steps: Catch Raw Hook and Python code to unpack the JSON.
Before you get started, create the service you'll use for this integration. Even if you use an existing on-call schedule, you'll probably want this activity separate from other technology services. You can name it something like "Slack Support" or "Frame Escalation."
Select the "Zapier" integration type. You can leave it named "Zapier." Keep the 32-character Integration Key for the service handy -- you might need it below.
Step 1: Webhook (Catch Raw Hook)
Select Catch Raw Hook and copy the webhook URL, then paste it into the Frame dialog in Slack. To create a webhook integration in Slack, open a DM with @frame
, enter /frame
, and select Integrations.
Incident create: Webhook on join
Incident acknowledge: Webhook on join
Incident resolve: Webhook on close
Before Zapier will let you continue after creating the webhook, you'll need to send some data. The easiest way to do this is to create your Zapier webhooks, enter them in as separate integrations in Frame for Slack (giving each a unique name), then opening and closing a frame in a channel.
You'll want to open a frame with a customer message, have an agent speak, then close the frame with /frame close
. Then you can go back to Zapier and complete your setup steps below.
Step 2: Code (Python) | Parse Webhook
Input Body:
body
| {{Step 1 Raw Body}}
Code:
import json
body = json.loads(input_data['body'])
body['userdata'] = json.dumps(body['userdata'])
output = body
Step 3: Filter
Incident creation: only continue if... Data Ticket Owner Email
does not exist
Incident acknowledgement: only continue if... Data Ticket Owner Email
exists
Incident resolution: no filter required
Step 4: PagerDuty
To OAuth, go to API keys (https://YOURDOMAIN.pagerduty.com/api_keys), select Create New API Key, and create a new key named something you'll remember, like "Frame Escalation." Use the API key to complete the auth flow in Zapier.
Service: Select the PagerDuty Service you created for this. If you don't see it in the dropdown, select "Use a Custom Value (Advanced)" and enter the 32-character integration key from the service.
Now, on to the steps specific to each lifecycle phase...
Incident creation: create incident
Description: Step 2 Data Actor Full Name
is waiting in Step 2 Data Frame Channel
Incident Key: Step 2 Data Frame Channel
Note: using the channel name as the incident key above is important, as it allows PagerDuty to auto-merge any duplicate incidents. There will only ever be on incident open per channel.
Source URL: Step 2 Data Slack Link
Source Name: Slack
Incident acknowledgement: acknowledge incident
Description: Acknowledged by Step 2 Data Actor Full Name
Incident resolution: resolve incident
Description: Resolved by Step 2 Data Actor Full Name
Updated over 4 years ago