Salesforce Service Cloud Integration Guide | PagerDuty

Salesforce Service Cloud + PagerDuty Integration Benefits

  • Orchestrate responses and actions around customer issues, sales opportunities, and other activities across your organization.
  • Customize when to notify the proper on-call team about relevant activities occurring in Salesforce Service Cloud.
  • Create and/or update Salesforce Service Cloud objects with relevant information as soon as there’s a PagerDuty incident update such as an acknowledge, resolve, reassign, etc.
  • Each PagerDuty subdomain can be connected to multiple Salesforce Service Cloud objects to streamline cross-organizational collaboration.
  • Access a Command Console interface that allows agents to create PagerDuty incidents and view linked incidents directly from a case record. The Command Console can be used to help identify customer-impacting issues and escalate urgent issues to engineering / IT.
  • Access a Status Dashboard that provides agents with status updates for ongoing, customer-impacting incidents and context that enables tailored customer communications.

📘

Pricing Plan

The Salesforce Service Cloud v3.7 integration is only available to accounts on Customer Service Professional, Customer Service Business or Digital Operations plans. Please contact our Sales Team if you would like to upgrade to a plan featuring our new Salesforce Service Cloud integration.

Version

  • This guide outlines configuration for the Salesforce Service Cloud v3.7 integration.
  • If you would like to upgrade from a previous version, please follow instructions in our Upgrade to v3.7 section.

📘

Looking for a Different Version?

The following integrations are also available:

How it Works

  • Once a Salesforce Service Cloud object is connected to your PagerDuty instance, new record creations and updates on that object are evaluated against rules that you predefine. If the rule criteria is met, PagerDuty will perform actions specified by those predefined rules, including creating new PagerDuty incidents and updating the fields of Salesforce Service Cloud objects.
  • PagerDuty can also send information to Salesforce Cloud, where you can define the evaluation criteria against the updates made in PagerDuty and select an action to be performed in Salesforce Cloud.

Requirements

Required Permissions to Configure or Upgrade the Integration

In Salesforce Cloud:

  • Permissions to install Salesforce Managed Package applications.
  • A Salesforce Professional, Unlimited or Enterprise edition, which can allow Apex classes to be run from a Managed Package.
  • Ensure that API Access is enabled on your Organization. Salesforce Organizations in Trial Mode will normally not have API access enabled.

In PagerDuty:

A Global Admin or Account Owner base role is required for configuration.

Required Permissions to Use the Integration

If you are using custom permissions in Salesforce, please see our FAQ for more information.

Integration Walkthrough

In PagerDuty

Create an API Key

  1. First, you will need to generate a REST PagerDuty API Key to allow Salesforce Service Cloud to connect to PagerDuty. Navigate to Integrations API Access Keys and click Create New API Key.
  2. Enter a Description (e.g. “Salesforce Service Cloud API Key”) and click Create Key.
  3. On the next screen, copy the API Key and paste it in a safe place for later use. Note: You will not have access to this key after this screen.
11161116

In Salesforce Service Cloud

Download the PagerDuty Application

  1. Open a new tab in order to reference the details in the PagerDuty web app that you just created. In your new tab, download the PagerDuty Application to your Salesforce Service Cloud Account. You will be prompted to select which users you want to download the application for. We recommend that you select Install for All Users. You will have more options to restrict which users can access PagerDuty functionality later during installation. Click Install.
  2. You will then be asked to approve third party access to PagerDuty APIs. Please check the box Yes, grant access to these third-party web sites and click Continue.
  3. If you see a message that says, “The app is taking a long time to install,” you will receive an email from Salesforce Service Cloud when the app has finished installation:
13941394

Example Email

Manage Connected App Permissions and Credentials

  1. Navigate to Setup Home Apps ​​App Manager PagerDuty Platform V3 select Manage from the right-hand dropdown. In the Permitted Users field, select Admin approved users are pre-authorized, click Ok when prompted and then click Save. This is a necessary step to ensure that PagerDuty rulesets function appropriately.
  2. Lower on the same page, click the Manage Profiles button under the Profiles heading.
  3. Check the box next to the Profile type (for example, System Administrator) belonging to the user whose username you entered in step 4 and click Save. This user’s PagerDuty permissions will be used to update records in Salesforce Service Cloud based on your rulesets.
  4. Navigate back to your Salesforce Service Cloud account, click the cog icon in the top right menu, select Setup and then search for Named Credentials.
  5. Click the New Named Credential button and enter the following information in the fields on the next screen:
FieldInstructions
LabelEnter PagerDuty_API.
NameThis should autofill after filling in the Label field.
URLUS service region: https://api.pagerduty.com
EU service region: https://api.eu.pagerduty.com
CertificateLeave this field blank.
Identity TypeSelect Named Principal
Authentication ProtocolSelect Password Authentication
UsernamePagerDutyAPI
PasswordPaste the PagerDuty API Key (generated in step 3 of the In PagerDuty section, above)
Generate Authorization HeaderUNCHECK
Allow Merge Fields in HTTP HeaderCHECK
Allow Merge Fields in HTTP BodyUNCHECK

Click Save.

Assign User Permissions for the PagerDuty Application

  1. All users logging in to the PagerDuty Command Console or Status Dashboard will need to have permissions to the relevant Salesforce Objects in the PagerDuty Managed Package. If the only user/user profile who plans to use this application is the user/user profile you selected in step 9, you can skip to step 14.
  2. As a Salesforce Administrator, navigate to Setup Users Permission Sets. Select the PagerDutyUser or PagerDutyAdmin permission set, click Manage Assignments and click Add Assignments. Select all users you want to assign the PagerDutyUser or PagerDutyAdmin permission set to, and then click Assign.

📘

Note

If you would prefer to use Salesforce Profiles, please see our FAQ for more information.

Add the PagerDuty Console to a Salesforce Service Cloud Case

  1. Next, you will need to add the PagerDuty application to the page where you’d like members of your team to have access. For this example, we’re going to add the PagerDuty app to the Salesforce Service Cloud Case.
  2. Navigate to any Salesforce Service Cloud Case in the Service Console. Click into the case and navigate to the cog in the upper right hand corner and click Edit Page.
  3. In the left side bar, search for “PagerDuty”. You can drag one of the following into the Case view in a placement of your choice:
  • PagerDuty Combined Console (Recommended): The best of PagerDuty, including both the PagerDuty Command Console and the PagerDuty Status Dashboard. With the Combined Console, frontline agents immediately become aware of customer impacting issues, and can engage key experts across the organization when they hear about a new high-priority issue.
  • PagerDuty Command Console: Only the PagerDuty Command Console. Recommended for any PagerDuty teams that do not plan to use the PagerDuty Status Dashboard.
  • PagerDuty Status Dashboard: Only the PagerDuty Status Dashboard. Best for teams that want to understand which issues are customer-impacting, or teams setting up 24/7 after hours support for the first time.
  1. Click Save, then click Activate, and when prompted, select the permissions that best fit your needs. We recommend:
  • Org Default click Assign as Org Default ​​Desktop Next Save
  • App Default Assign as App Default Service Console ​​ Desktop and Phone Next Save.
  1. Navigate back to any case to confirm you can see the selected application.

Add the PagerDuty Console to a Salesforce Service Cloud Incident or other Non-Case Record

  1. If you would like the Command Console or Status Dashboard to work with other Salesforce Service Cloud Records (e.g. an Incident or Opportunities), you can repeat the previous section in this guide starting on the record where you want the console to appear.

Configure the PagerDuty Application

  1. Click the App Launcher in the top left menu, search and select PagerDuty Configuration and perform the following:

In the SUMMARY Tab:

FieldInstructions
ConnectionIf the Named Credential was properly configured, the Connection should show an OK message in green text.
Object MappingsDisregard the error message, this will be addressed in the next step.
WebhookDisregard the error message, this will be addressed in the next step.

In the WEBHOOKS Tab:

Enter the Salesforce Service Cloud username of a Salesforce user with the required permissions to carry out the changes needed with the integration, then click Save.

This webhook subscription saves the subdomain for the Salesforce account to the Salesforce Extension page in your PagerDuty account.

In the OBJECT MAPPINGS Tab:

FieldInstructions
Sync Salesforce Service Cloud Comments to PagerDuty Notes (optional)You can sync the Salesforce Service Cloud Case Comments to PagerDuty Notes, but please be aware that syncing between the two may consume your API request limits in Salesforce Service Cloud.
Enable PagerDuty triggers on Case Creation and Case Comments (optional)You can Enable PagerDuty triggers for Case Creation and Case Comments.
Enable PagerDuty triggers on Incident Creation (optional)You can Enable PagerDuty triggers for Incident Creation (Salesforce Incident Management needs to be enabled to use this feature).
PagerDuty Integration EmailSearch and select the email that belongs to the integration user who has permission to create and update incidents in PagerDuty.

Click Save.

In the LOGGER Tab:

FieldInstructions
Log LevelSelect from the following log types:

- Debug: This type will record and display all log types.
- Info: This type will record and display both info and error logs.
- Error: This type will record and display error logs only.
Storage Delete IntervalsSelect the number of days for PagerDuty logs to be stored in Salesforce before they are deleted.

Click Save.

Configure Rulesets

📘

Upgrading From V2 to V3

If you have upgraded your PagerDuty application in Salesforce Service Cloud from V2 to V3, existing rulesets will still remain. If needed, you can create new rulesets by following the instructions below.

  1. Now you can set up rules to create/modify incidents based on the content of a Salesforce record, or vice versa. Select the RULESETS tab. This is where you will build the rules that will specify what should happen to the object and fields when PagerDuty sends an update back to Salesforce Service Cloud. Click Add Ruleset on the right, enter a Ruleset Name and click Save. This Ruleset is a folder that will hold any rules you create. For ease of troubleshooting, we recommend that you maintain one ruleset for actions triggered from Salesforce to PagerDuty, (e.g., "SFDC > PD”) and one ruleset for actions triggered from PagerDuty to Salesforce (e.g., “PD > SFDC”).
  2. Next, Click the name of the rule and then click Add Rules. Enter a Rule Name, click Save and then click the name of the rule. Each rule will ask for conditions that should be met prior to performing the actions specified in the latter part of the rule definition.
FieldInstructions
Choose Salesforce ObjectSearch and select the Salesforce Service Cloud object that you would like to map to PagerDuty based on this rule’s criteria.
Run rule onDepending on the direction you would like actions to be triggered, make the following selection:

- Salesforce to PagerDuty Actions: Select [OBJECT-LABEL] create or update.

OR

- PagerDuty to Salesforce actions: Select PagerDuty incident create or update.
WhenDepending on your preferences, select:

- All conditions are met

OR

- Any conditions are met
  1. Click Add Condition. Under Choose Field, you will have the option to choose fields from PagerDuty, or from the Salesforce Service Cloud object that this rule will run on. The following PagerDuty Fields are available:
FieldDefinition
Event TypeRun the rule based on the type of PagerDuty event. Trigger, Acknowledge, Resolve, Assign, Escalate, Custom or Delegate.
Incident TitleRun the rule based on whether the PagerDuty incident Title matches a predefined string.
Incident StatusRun the rule based on the PagerDuty incident’s status. Triggered, Acknowledged or Resolved.
PagerDuty ServiceRun the rule based on events generated by a selected PagerDuty service.
PagerDuty Service NameRun the rule based on events generated by a PagerDuty service name that matches a predefined string.
PagerDuty Escalation PolicyRun the rule based on incidents assigned with a selected PagerDuty escalation policy.
PagerDuty Escalation Policy NameRun the rule based incidents assigned with a PagerDuty escalation policy name that matches a predefined string.
PagerDuty Incident PriorityRun the rule based on the selected incident priority.
UrgencyRun the rule based on the selected incident urgency.

The available Salesforce Fields vary by object label and account configuration. Please search for your object’s fields in Salesforce’s documentation for more details.

  1. Next, select an Operator and enter a value to complete the condition. You may choose to add multiple conditions for each rule. Once you are done adding your conditions, proceed to the next step.
  2. Select when the following actions should be executed after the conditions are met:
  • New PagerDuty Incidents and Salesforce Objects created by this ruleset will only execute the actions when a new object is created in PagerDuty or in Salesforce.
  • All linked PagerDuty Incidents and Salesforce objects that match the conditions specified above will execute the actions on new and existing linked objects in PagerDuty or in Salesforce.
  1. Now click Add Action and select a PagerDuty Action or Salesforce Action. You may choose multiple actions to be triggered from each rule.
PagerDuty ActionsDefinition
Create new Incident, if there are no linked incidentsIf rule conditions are met, create a PagerDuty incident.
Create new Incident, if there are no linked incidents
Set PagerDuty Incident Title
If rule conditions are met, a PagerDuty incident will be created with a custom, preconfigured title.

To create a custom incident title:

- Select the PagerDuty Action Create new Incident, if there are no linked incidents.
- Click the Set PagerDuty Incident Title dropdown and select Use Custom Incident Title.
- You can add preliminary custom text as the prefix and select up to three Salesforce case fields to construct the custom incident title.
- Use the Preview bar to see how the title will look. Incident titles longer than 1024 characters will be truncated when the incident is created.
Acknowledge IncidentIf rule conditions are met, acknowledge the PagerDuty incident.
Resolve IncidentIf rule conditions are met, resolve the PagerDuty incident.
Set Incident PriorityIf rule conditions are met, set the PagerDuty incident’s priority to a specified value.
Set Incident UrgencyIf rule conditions are met, set the PagerDuty incident’s urgency to a specified value.
Run Response PlayIf rule conditions are met, run a specified response play on the incident.
Run Automation ActionIf rule conditions are met, run a specified Automation Action on the incident.
ReassignIf rule conditions are met, reassign the PagerDuty incident.
Add RespondersIf rule conditions are met, add responders to the PagerDuty incident.
Salesforce ActionsDefinition
Set [SALESFORCE-OBJECT] field valueIf rule conditions are met, set an object’s specified field value.
Create new [SALESFORCE-OBJECT]If rule conditions are met, create a new specified object.
  1. Click Save to complete the rule configuration. Navigate back to the RULESETS tab and click the toggle switch next to your ruleset to Enabled.
948948

Enable Ruleset

  1. Next, navigate back to your PagerDuty account and click Services, select Service Directory and click the name of the service that you just connected to the Salesforce Service Cloud OAuth Flow webhook. Manually trigger a test incident on this service.
  2. Once the test incident has been triggered, return to Salesforce Service Cloud, click the App Launcher and search and select PagerDuty Logs to see if a webhook from PagerDuty arrives. When you receive the webhook, the integration is complete. If you do not receive the webhook, check your log management tool to troubleshoot why the webhook failed to deliver.

Upgrade to v3.7

Users who already have an earlier version of v3 installed in their Salesforce Service Desk environments may follow the instructions below to upgrade to v3.7. You can check the current version of PagerDuty you have installed in Salesforce Service Cloud by navigating to Setup search and select Installed Packages.

In Salesforce Service Cloud

Upgrade the PagerDuty Application

  1. Download the PagerDuty Application to your Salesforce Service Cloud Account. You will be prompted to select which users you want to download the application for. We recommend that you select Install for All Users. You will have more options to restrict which users can access PagerDuty functionality later during installation. Click Upgrade.
  2. You will then be asked to approve third party access to PagerDuty APIs. Please check the box Yes, grant access to these third-party web sites and click Continue.
  3. After the app has finished upgrading, navigate to App Launcher in the top left menu, and search and select PagerDuty Configuration. In the WEBHOOKS tab, subscribe to the new PagerDuty webhooks v3 by entering the Salesforce Service Cloud username of a Salesforce user with the required permissions to carry out the changes needed with the integration, then click Save.
  4. After the new webhooks subscription is complete, you will see a prompt to remove old PagerDuty webhooks from your PagerDuty account. Click the link to prevent duplicate incident creation in PagerDuty.
  5. You are now ready to use the newest version of the PagerDuty for Salesforce application.

Salesforce Service Cloud User Guide

Please read our User Guide for more information on how to use the integration after it has been configured.

FAQ

How can I use this application to set up 24/7 after-hours support for high priority cases or premium customers?

  1. First, create a PagerDuty service for your Support team and create an an on-call rotation that will determine which service agents will be alerted when an urgent issue arises.
  2. Next, create a ruleset that creates an incident on this service whenever a new Salesforce case is created that meets your qualifying criteria (e.g., a high priority Salesforce Service Cloud case outside of business hours).
  3. Trigger a case that meets the qualifying criteria in your ruleset to confirm that the ruleset is working as expected.
17011701

Example 24/7 After-Hours Support Ruleset

How can I create new cases in Salesforce Service Cloud based on the content of a PagerDuty incident?

Create a rule On PagerDuty Update instead of [Object] Create/Update, specify what conditions to look for on a PagerDuty update, and what you would like Salesforce Service Cloud to do when it meets that criteria. Make sure you also use Set [SALESFORCE-OBJECT] field value for ALL required fields in your Salesforce Service Cloud object.

For example, if you want to automatically create a Salesforce Service Cloud Case object when a PagerDuty incident is created on Service “XYZ”, you would have a Ruleset that looks like the following:

16001600

Example ruleset for creating new cases in Salesforce Service Cloud based on the content of a PagerDuty incident

Can I use PagerDuty Rulesets with other Salesforce records besides Cases and Incidents?

Yes. Please follow these steps to allow PagerDuty rulesets to interact with other Salesforce records:

  1. In Salesforce Service Cloud, click the cog icon select Setup click Objects and Fields in the left hand menu select Object Manager.
  2. Click the Label name of the object on which you would like to create a trigger and click Triggers in the left hand menu. Click New on the right side of the screen.
  3. Enter the following text as a trigger body, replacing [SALESFORCE-OBJECT] with your Salesforce Service Cloud object:
trigger PagerDuty[SALESFORCE-OBJECT]Trigger on [SALESFORCE-OBJECT] (after insert, after update) {
    if (!System.isFuture() && !System.isBatch()) {
        String oldStr = JSON.serialize(Trigger.oldMap);
        String newStr = JSON.serialize(Trigger.newMap);
        if (!Test.isRunningTest()) pagerdutyinc.PagerDutyEngineLauncher.launchByTrigger(oldStr, newStr, Trigger.isInsert);
    }
}

Example:

trigger PagerDutyOpportunityTrigger on Opportunity (after insert, after update) {
    if (!System.isFuture() && !System.isBatch()) {
        String oldStr = JSON.serialize(Trigger.oldMap);
        String newStr = JSON.serialize(Trigger.newMap);
        if (!Test.isRunningTest()) pagerdutyinc.PagerDutyEngineLauncher.launchByTrigger(oldStr, newStr, Trigger.isInsert);
    }
}
  1. Click Save. Repeat these steps for each object on which you would like to create a trigger.

Why don’t I see any data on my Status Dashboard?

If you don’t see any data on your Status Dashboard, please confirm that you have a one configured in PagerDuty. To check, navigate to https://[your PagerDuty subdomain].pagerduty.com/status-dashboard.

What kind of custom permissions do users need to use this integration?

If you use custom permissions in Salesforce, you will need to ensure that agents have the correct permissions to use and access the PagerDuty integration. There are four permission sets included in the managed package that can be given to users.

PagerDutyAdministrator PagerDutyConfiguration read
write
PagerDutyIncident Mapping read
create
edit
delete
PagerDutyRules & Rulesets read
create
edit
delete
PagerDutyConfiguration Tab on
PagerDutyAuditor PagerDutyConfiguration read
PagerDutyIncident Mapping read
PagerDutyRules & Rulesets read
PagerDutyConfiguration Tab on
PagerDutyManager PagerDutyConfiguration read
PagerDutyIncident Mapping read
create
edit
delete
PagerDutyRules & Rulesets read
create
edit
delete
PagerDutyConfiguration Tab on
PagerDutyUser PagerDutyConfiguration read
PagerDutyIncident Mapping read
create
edit
PagerDutyRules & Rulesets read
PagerDutyConfiguration Tab off

If you do not want to add permission sets to your users, you may check their profiles and ensure the profiles have similar object permissions for their user type.

How can I troubleshoot issues during login to the PagerDuty console?

  • Check to make sure all users have valid permissions.
  • Check to make sure the redirect URL is set correctly in PagerDuty.
  • Check to make sure that the OAuth app has read/write privileges and not just read privileges.

How can I troubleshoot my integration?

We have provided a logging tool to help troubleshoot problems in the integration. Under the LOGGER tab in the PagerDuty Configuration, you can turn on logging by selecting one of the following levels and clicking Save:

13061306

Logger Tab for Troubleshooting

How can I troubleshoot my Rulesets?

We have provided a logging tool to help troubleshoot problems in the integration. To access PagerDuty logs, click App Launcher and search for “PagerDuty Logs”. When you navigate to the page, you will see a record of all webhooks successfully delivered to Salesforce Service Cloud from PagerDuty, as well as all errors. If you are still experiencing issues, please reach out to PagerDuty support.

Can PagerDuty actions be invoked from Salesforce Flows?

PagerDuty actions cannot currently be invoked from Salesforce Flows. To share your interest in the development of this feature, please contact PagerDuty support.

How can I set up PagerDutyUser equivalent permissions with Salesforce Profiles?

As a Salesforce Administrator:

  1. Log in to Salesforce Service Cloud and navigate to Setup Users Profiles select the Profile to modify.
  2. Add the required permissions below:

Object Level Permissions for a PagerDuty User

ObjectsRequired Permissions
PagerDutyConfigurations
PagerDutyRules
PagerDutyRulesets
read
view all
PagerDutyIncidentMappingsread
create
edit
view all

Field Level Security for a PagerDuty User

ObjectsRequired Permissions
PagerDutyConfigurationsRead Access Required for the following Fields:

API Token
Created By
Last Modified By
Logging JSON
Mapping JSON
Owner
PagerDuty Base Url
PagerDuty Configuration
PagerDuty Default Email

Edit Access Required for the following Fields:

Owner
PagerDutyConfiguration
PagerDutyRulesRead Access Required for the following Fields:

Created By
Last Modified By
Owner
PagerDutyRule
Rule Name

Edit Access Required for the following Fields:

Owner
PagerDutyRule
Rule Name
PagerDutyRuleSetsRead Access Required for the following Fields:

Created By
Last Modified By
Owner
PagerDutyRuleset
Ruleset Name

Edit Access Required for the following Fields:

Owner
PagerDutyRuleset
Ruleset Name
PagerDutyIncidentMappingsRead Access Required for the following Fields:

Created By
Incident ID
Last Modified By
Linked Case
Owner
PagerDutyIncidientMapping
SObject ID
Subdomain

Edit Access Required for the following Fields:

Incident ID
Linked Case
Owner
PagerDutyIncidentMapping
SObject ID
Subdomain

What can I do about an error that says I don't have enough trial cache capacity while upgrading in my developer account?

a. Salesforce Developer accounts must request Cache Partition Capacity in Salesforce Service Cloud. Click Setup search and select Platform Cache Request Trial Capacity.
b. Set Session Cache Allocation (Set Trial 2)
c. Set Org Cache Allocation Trial (Set Trial 2)
d. Click Save.