top of page
Drone Over the Mountains
The Essential Guide on Observability, monitoring, tools, and integrations to our Business - Learning Never Stops

A simple way to Integrate the PagerDuty and Service Desk Plus On Demand

  • shyamrangaraju9
  • Aug 16, 2023
  • 4 min read

Updated: Aug 17, 2023

PagerDuty – Service Desk Plus (SDPOD) Integration


What is PagerDuty:

PagerDuty is a digital operation platform that provides reliable notifications, on-call, scheduling automatic escalations, and other functionality to help teams detect and fix problems quickly.


What is Service Desk Plus:

ServiceDesk Plus integrates your help desk requests and assets to allow you to manage your IT in an effective way. The software helps you implement ITIL best practices and troubleshoot IT service requests faster.


Use Case:

  • Let's take an example of an organization having 150+ engineers working on business operations and needing to deliver operational outcomes via the ticketing system. These outcomes are being delivered using ITIL methodologies using ITSM tools. In this use case, the organization is using Service Desk Plus (Zoho product) ITSM.

  • The infrastructure, and applications of the organization are getting monitored via different monitoring tools and all are integrated with this ITSM via API or email sources. The monitoring data to this ITSM is flooded because of no control implemented via a noise reduction approach.

  • In addition to this, the routing of tickets is not efficient that are coming from these monitoring tools which is overhead for the engineers. Furthermore, the appropriate context is not provided for each and every ticket which is adding further load on the engineer’s efficiency.

  • To overcome this issue, the organization has implemented the PagerDuty which provides the AIOPS capabilities and noise reduction process with proper ticket routing, on-call schedules, and an appropriate automated escalation matrix.

  • However, this has increased the cost for the organization as 150+ engineers need to get the PagerDuty licenses.

Solution:

The best approach is to take the limited licenses for PagerDuty who can administrate the PagerDuty services, and integrate the system with the Service Desk Plus ITSM where all the engineers can work on the end system. This will reduce costs and also provide actionable incidents and contextualization of the tickets.


The below diagram represents the e-bonding between two different systems.


Requirements for Integration:


Integration Understanding:

In order to establish the e-bonding between the two systems, we should use the webhooks between PagerDuty and Service Desk Plus because PagerDuty is not providing any out-of-box integration with Service Desk Plus. Below is the script with all the descriptions that should be configured on the Service Desk Plus – Developer space -> Call Back Functions. Service Desk Plus will generate a Webhook link in this callback function which can be used on the PagerDuty side for establishing the e-bonding between the systems.


This integration will create the ticket creation, updation, annotations, and resolution between both systems.


Deluge Script for ticketing integration:

numberField = "xxxxxxx"; ## This should be your PagerDuty ticket number field – Create a new field in the incident template by following the link - https://help.servicedeskplus.com/configurations/helpdesk/request_template.html


textField = "xxxxxxx"; ## This should be your PagerDuty ticket ID field – Create a new field in the incident template by following the link - https://help.servicedeskplus.com/configurations/helpdesk/request_template.html


inputJson = body.toMap(); ## This is the mapping of the JSON payload generated from PagerDuty to Service Desk Plus. This may be a ticket creation payload, ticket updation payload, or ticket closure payload. PagerDuty uses a V3 payload for these events.


stringFromInput = inputJson.get("event"); ## The event that triggered the webhook and stored in inputJson variable mapped to the body in the above step.


eventType = stringFromInput.get("event_type"); ## The type of the event stored in stringFromInput variable. This usually provides a description of what happened (e.g. incident.triggered, incident.priority_updated).


incidentStatus = stringFromInput.get("data").get("status"); ## Data specific to the event_type that occurred stored in stringFromInput variable. And Status represents the ticket state (e.g. incident triggered or updated).


reqSubject = stringFromInput.get("data").get("title"); ## Data specific to the event_type that occurred stored in stringFromInput variable. And the Title represents the ticket subject.


requesterEmail = "email ID"; ## Requester EMAIL ID.


incidentNum = stringFromInput.get("data").get("number"); ## Data specific to the event_type that occurred stored in stringFromInput variable. And the number represents the ticket number.


uniqueId = stringFromInput.get("data").get("id"); ## Data specific to the event_type that occurred stored in stringFromInput variable. And the number represents the ticket ID.


appName = "Group Name"; ## This would be your Service Desk Plus group name or assignment team.

priority = stringFromInput.get("data").get("priority").get("summary"); ## Data specific to the event_type that occurred stored in stringFromInput variable. And Priority represents the priority unique ID and summary is the priority number (e.g. P1, P2, P3, etc.).

info priority;


Below is the ticket creation event that occurs from the PagerDuty and it hits the Webhook mapped to Service desk plus.

###################################################################################

//Ticket Creation

if(eventType == "incident.triggered" && incidentStatus == "triggered" && priority == "define your priorities e.g. P1, P2 etc.")

{

resp = zoho.sdp.invokeurl

[

url :"/app/" + appName + "/api/v3/requests" ## Zoho API for getting the incident requests.

type :GET

parameters:{"input_data":{"list_info":{"search_criteria":{"field":"udf_fields." + numberField,"condition":"eq","value":incidentNum,"logical_operator":"AND"}}}}

];

info resp;

if(resp.get("list_info").get("row_count") == "0") ## Validate if the ticket field is empty or not to process the integration request.

{

message = reqSubject; -## Ticket Description

info resp;

response = zoho.sdp.invokeurl

[

url :"/app/" + appName + "/api/v3/requests/" ## Post the request using below parameters.

type :POST

parameters:{"input_data":{"request":{"template":{"id":"Incident template ID"},"subject":reqSubject,"description":message,"requester":{"email_id":requesterEmail},"urgency":{"name":"High"},"impact":{"name":"Medium"},"group":{"name":"Group Name or Assignment Team"},"udf_fields":{numberField:incidentNum,textField:uniqueId}}}}

];

}

}

else if(eventType == "incident.resolved" && incidentStatus == "resolved")

{

resp = zoho.sdp.invokeurl

[

url :"/app/" + appName + "/api/v3/requests"

type :GET

parameters:{"input_data":{"list_info":{"search_criteria":{"field":"udf_fields." + numberField,"condition":"eq","value":incidentNum,"logical_operator":"AND"}}}}

];

info resp;

for each request in resp.get("requests")

{

resolutionupdate = zoho.sdp.invokeurl

[

url :"/app/" + appName + "/api/v3/requests/_close?ids=" + request.get("id") ## Ticket closure by validating the PagerDuty unique ID mapped to Service Desk Plus ID.

type :PUT

parameters:{"input_data":{"request":{"closure_info":{"closure_comments":"This alert got resolved from monitoring system"}}}}

];

info resolutionupdate;

}

}

return response;

pdnotes = stringFromInput.get("data").get("content"); ## Data specific to the event_type that occurred stored in stringFromInput variable. And content represents the content of the note defined on the ticket.

info pdnotes;

if(eventType == "incident.annotated")

{

resp = zoho.sdp.invokeurl

[

url :"/app/" + appName + "/api/v3/requests"

type :GET

parameters:{"input_data":{"list_info":{"search_criteria":{"field":"udf_fields." + textField,"condition":"eq","value":pduniqueId,"logical_operator":"AND"}}}}

];

info resp;

for each request in resp.get("requests")

{

notesupdate = zoho.sdp.invokeurl

[

url :"/app/" + appName + "/api/v3/requests/" + request.get("id") + "/notes" ## Notes update API from Service Desk Plus with post.

type :POST

parameters:{"input_data":{"request_note":{"description":pdnotes}}} ## adding notes inputs.

];

info notesupdate;

}

}

return notesupdate; ##################################################################################

This is it..use these base configurations and build your script for your requirements. Please feel free to reach me on LinkedIn or by mail mentioned on the site to get more insights on this setup. Thank you.

Comments


itprovident@​yahoo.com

  • My LinkedIn

Get in touch

bottom of page