SDP-SDPMSP integration

SDP-SDPMSP integration

This document is to understand the integration possibilities between ServiceDesk Plus (SDP) and ServiceDesk Plus-MSP (SDP MSP) helpdesk applications :

What data will be synced between SDP and SDP MSP?
 Data created/updated in SDP will be synced with SDP MSP. 

Modules which can be synced are as follows :
Request : 
  1. Requests created alone (Conversations wont be synced)
  2. Fields like - Technicians, Group
  3. Tasks associated with the request.
  4. Worklog
Changes :
  1. Changes created
  2. Tasks
  3. Worklog

Prerequisites:

  1. SDP MSP build number should be greater than 9421
  2. SDP build number should be 9426
Place the below-mentioned files in the appropriate location in SDP instance :
  1. Extract the attached zip file in <sdphome>\integration\custom_scripts folder
  2. Edit the configuration_MSP file and give the details for MSP build
  3. Edit the configuration file and give the details for the SDP Build build
Place the below-mentioned files in the appropriate location in SDP MSP instance :(configuration.json,configuration_MSP.json,functions.py  should be placed  under SDP instance too)
  1. configuration.json
  2. configuration_MSP.json
  3. functions.py
  4. importtasks_json.py
  5. importworklogs_json.py
How does it work?

Data Migration:

Request and change Data migrated through custom trigger using conditionless criteria as mentioned in the below link.

You need to execute the below query in SDP's database before proceeding.

Query for Conditionless criteria:
update globalconfig set paramvalue = 'true' where category='CUSTOM_TRIGGER' and parameter='IS_EMPTY_CRIT_ALLOWED';


The remaining task and worklog entities has been migrated through custom schedules. For that we need to configure a query report in admin ->Custom Schedule. Detailed explanation shown below.

For Request module:
-------------------------------------------------------------------------------

Request Data migrated through custom trigger using conditionless criteria.

You need to create certain additional fields in SDP and SDP MSP to make it work.

In SDP MSP build:

1. Goto Admin -> Incident additional fields.
2. Create a numeric additional field named SDP Ticket ID (additional field) - This is to store SDP ticket ID in SDP MSP respective ticket
3. Drag this field in the respective template so that it will get reflected in UI.

In SDP Build:

1. Edit CreateRequest_sdpmsp file in the and change the below value.

udf_Name="SDP Ticket ID
udf_APIName="udf_sline_353" --> refer your corresponding APIName from the incident additional fields. Refer SDP MSP Incident additional field page to know the APIName.
account="My Org Inc" --> You can provide the account name to which you want to sync the tickets.

Here SDP Ticket ID is the additional field name in SDP MSP build
Here udf_sline_353 is the additional field API name in SDP MSP build

2. Login to the SDP application and create a Admin -> custom triggers.


Provide py CreateRequest_sdpmsp.py $COMPLETE_JSON_FILE in Action Type -> Execute script. like below 



Now create a request in SDP and check the same is present in sdp_msp build too.


For Change module:
-------------------------------------------------------------------------------
Change Data migrated through custom trigger.

In SDP Build changes:

Similar to Incidents , we need to create Change additional fields for changes also.

1.Need to create an additional field in SDP build to store MSP change id.
2.Drag the field in the respective template so that it will get reflected in UI
3. Edit CreateChange_sdpmsp file and change the below value.

udf_fieldName="msp_changeid"
account="My Org Inc"-->Can be changed for the account the change needs to be created.


4. configure a change custom trigger like below


py CreateChange_sdpmsp.py $COMPLETE_JSON_FILE

now create a change request and check the same present in SDP MSP build too.

For Task Module:

Task Data migrated through custom schedules using query

Edit importtasks_json.py and change the below value.

req_udf_Name="SDP Ticket ID"
req_udf_APIName="udf_sline_353"
ch_udf_fieldName="msp_changeid"
ch_udf_APIName="udf_11103"

SDP Ticket ID,udf_sline_353 are request additional field name and its API name which created for request import.
ch_udf_fieldName,ch_udf_APIName are change additional field name and its API name which created for change import.

Query for custom schedule:
The configurations should be done under MSP build

For PGSQL:
SELECT taskdet.TASKID AS "taskid",taskdet.MODULE "module" FROM TaskDetails taskdet 
left join TaskDetailsHistory th ON taskdet.TASKID=th.TASKID
left join TaskDetailsHistorydiff thd on th.historyid=thd.historyid
where taskdet.MODULE in ('Request','change') and  (extract(epoch from(now()::TIMESTAMP -  to_timestamp(taskdet.createddate/1000)::TIMESTAMP))/3600 < 1 or
th.historyid=
    (SELECT max(th1.historyid) FROM TaskDetailsHistory th1
     WHERE th1.TASKID =th.TASKID and extract(epoch from(now()::TIMESTAMP -  to_timestamp(th1.operationtime/1000)::TIMESTAMP))/3600 < 1)  )

For MSSQL:
SELECT taskdet.TASKID AS "taskid",taskdet.MODULE "module" FROM TaskDetails taskdet 
left join TaskDetailsHistory th ON taskdet.TASKID=th.TASKID
left join TaskDetailsHistorydiff thd on th.historyid=thd.historyid
where taskdet.MODULE in ('Request','change') and  ((str(cast(DATEDIFF(s, '19700101', GETUTCDATE()) as float)*1000,13,1)-taskdet.createddate)/1000/60 < 60 or th.historyid=
    (SELECT max(th1.historyid) FROM TaskDetailsHistory th1
     WHERE th1.TASKID =th.TASKID and (str(cast(DATEDIFF(s, '19700101', GETUTCDATE()) as float)*1000,13,1)-th1.operationtime)/1000/60 <60)  )


Run the above query under reports save the report and configure the same under Admin -> Custom Schedules-> Configure a one hour periodic custom schedule like below.


py importtasks_json.py 

For worklog Module:
Worklog Data migrated through custom schedules using query

Edit importworklogs_json.py and change the below value.

req_udf_Name="SDP Ticket ID"
req_udf_APIName="udf_sline_353"
ch_udf_fieldName="msp_changeid"
ch_udf_APIName="udf_11103"

SDP Ticket ID,udf_sline_353 are request additional field name and its API name which created for request import
ch_udf_fieldName,ch_udf_APIName are charge additional field name and its API name which created for change import.

Query for custom schedule:
For PGSQL
SELECT  (ct.chargeid) "chargeid",wo.WORKORDERID AS "id", 'request' "module" FROM WorkOrder wo 
LEFT JOIN WorkOrderToCharge wotoc ON wo.WORKORDERID=wotoc.WORKORDERID
LEFT JOIN ChargesTable ct ON wotoc.CHARGEID=ct.CHARGEID
Left join workorderhistory woh on wo.workorderid=woh.workorderid
WHERE  woh.operation like '%requestworklog%' and
woh.historyid = (select max(woh1.historyid) from workorderhistory woh1
where woh1.workorderid=wo.workorderid and woh1.operation like '%requestworklog%'  and
extract(epoch from(now()::TIMESTAMP - to_timestamp(woh1.operationtime/1000)::TIMESTAMP))/3600 < 1)
UNION
SELECT chargeTable.chargeid "chargeid",chdt.changeid AS "id", 'change' "module" FROM changedetails chdt
LEFT JOIN ChangeToCharge changeCharge ON chdt.CHANGEID=changeCharge.CHANGEID
LEFT JOIN ChargesTable chargeTable ON changeCharge.CHARGEID=chargeTable.CHARGEID
Left join changehistory coh on chdt.changeid=coh.changeid
WHERE  coh.operation like '%changeworklog%' and
coh.historyid = (select max(coh1.historyid) from changehistory coh1
where coh1.changeid=chdt.changeid and coh1.operation like '%changeworklog%'  and
extract(epoch from(now()::TIMESTAMP - to_timestamp(coh1.operationtime/1000)::TIMESTAMP))/3600 < 1)


MSSQL
SELECT  (ct.chargeid) "chargeid",wo.WORKORDERID AS "id", 'request' "module" FROM WorkOrder wo 
LEFT JOIN WorkOrderToCharge wotoc ON wo.WORKORDERID=wotoc.WORKORDERID
LEFT JOIN ChargesTable ct ON wotoc.CHARGEID=ct.CHARGEID
Left join workorderhistory woh on wo.workorderid=woh.workorderid
WHERE  woh.operation like '%requestworklog%' and
woh.historyid = (select max(woh1.historyid) from workorderhistory woh1
where woh1.workorderid=wo.workorderid and woh1.operation like '%requestworklog%'  and
(str(cast(DATEDIFF(s, '19700101', GETUTCDATE()) as float)*1000,13,1)-woh1.operationtime)/1000/60 <60)
UNION
SELECT chargeTable.chargeid "chargeid",chdt.changeid AS "id", 'change' "module" FROM changedetails chdt
LEFT JOIN ChangeToCharge changeCharge ON chdt.CHANGEID=changeCharge.CHANGEID
LEFT JOIN ChargesTable chargeTable ON changeCharge.CHARGEID=chargeTable.CHARGEID
Left join changehistory coh on chdt.changeid=coh.changeid
WHERE  coh.operation like '%changeworklog%' and
coh.historyid = (select max(coh1.historyid) from changehistory coh1
where coh1.changeid=chdt.changeid and coh1.operation like '%changeworklog%'  and
(str(cast(DATEDIFF(s, '19700101', GETUTCDATE()) as float)*1000,13,1)-coh1.operationtime)/1000/60 <60)


Run the above query under the report and save and configure the same under Admin -> Custom Schedules-> Configure a one-hour periodic custom schedule like below







          • Related Articles

          • SDP - SDP MSP Integration using Custom Triggers

            This article helps users to integrate ManageEngine ServiceDesk Plus (SDP) - ServiceDesk Plus MSP (SDP MSP) using Custom triggers and Custom Schedules feature.  This is compatible with SDP Build - 11113 and SDP MSP Build - 10507 This will help the MSP ...
          • ADMP integration Issues with SDP MSP

            Please check the below if you get any errors while doing integration 1) ADMP application must be accessible from the browser of SDP application server. Similarly, SDP application must be accessible from the browser of ADMP application server. This is ...
          • Integration with other helpdesk tools

            Please note that, we do not have direct integration of SDP MSP with other HelpDesk tools like ServiceNow. However if any HelpDesk has APIs for all Create, Update, Close operations, then you can make use of the our APIs and custom triggers to achieve ...
          • CTI Integration internal configuration for testing

            Example format for CTI Integration testing ...
          • Integration with Opmanager MSP - Network and Monitoring tool for MSP's

            SDP MSP integrates  Opmanager MSP - Network and Monitoring tool for MSP's, for more details refer to the below https://www.manageengine.com/network-monitoring-msp/sdp-msp-integration.html