SDP-Servicenow integration can be achieved using Python scripts by installing Python runtime in builds older than 11120 but with newer builds, it can be done with Deluge scripts and the built-in Deluge runtime.
Deluge does not support username-password encoding. Hence it has to be manually encoded and updated in the configuration file.[FileName: global_function_4-ServiceNow_Configurations.txt]
For builds older than 11120, check the procedure in this link.,
Creating a ServiceNow ticket when a SDP ticket is created
Create an additional field in ServiceDesk Plus:
1. We need to create two additional fields
ServiceNow Id --> For storing the ticket Id from ServiceNow
Go to Admin > Incident - Additional fields > Add field > Create a single line additional field and note down the API Field Name
ServiceNow sys_id --> For storing the ServiceNow incident sys_id (By using sys_id we can close the ticket in ServiceNow using API)
Goto Admin > Incident - Additional fields > Add field > Create a single line additional field and note down the API Field Name
2. Add the newly created additional fields to the incident template.
Creating Additional Field in ServiceNow:
1. We need one additional field to hold the ServiceDesk Plus ticket id.
2. Login to ServiceNow and search Incidents > Click the incidents tab > Click New button as shown below
3. Click on Additional Actions > Configure > Form Layout
4. Create a new additional field called "SDP Ticket ID" and make sure created field is available under Selected fields
5. Once additional field is created, we need to find out the ID to make API call. Create a dummy incident request > Edit the request > Inspect element and get the additional field id
Creating a ServiceNow ticket when a SDP ticket is created
Steps to configure:
1. ServiceNow configuration informations are stored in servicenow_config.json
2. For Python:
- Download and extract the python_integration.zip
- Move create_servicenow.json, functions.py, configuration.json, create_servicenow_ticket.py,servicenow_config.json files to MangeEngine/ServiceDesk/integration/custom_scripts folder
- Edit configuration.json and update url and technician_key
- Edit servicenow_config.json and update servicenow configurations like url,username,password
- url >> ServiceNow server url (sample : https://dev79461.service-now.com%29/
- username >> SeriviceNow username
- password >> ServiceNow password
- update api_fields >> fields mapping between SDP to Servicenow
3. For Deluge:
- Download the attached scripts. Copy the contents into request custom functions.
- Goto Admin > Request Custom Function > Custom Function > New > Paste the custom function content
- Goto Admin > Request Custom Function > Global Function > New > Paste the global function contents.
4. Create a Custom Trigger to get executed when a request is created.
Criteria: ServiceNow_ID is Null
Action Executor:
Python: py create_servicenow_ticket.py $COMPLETE_V3_JSON_FILE
Deluge: Select the create - custom function
5. If a ticket is created with required criteria, the ServiceNow script gets executed and the respective additional fields gets populated.
Closing a ServiceNow ticket when a SDP ticket is closed
Steps to configure:
1. Create a Custom Trigger in SDP as shown below
2. Move close_servicenow_ticket.py file to MangeEngine/ServiceDesk/integration/custom_scripts folder
3. Resolution notes, Resolution code are mandatory for closing a ServiceNow ticket.
4. We can either move the SDP Resolution and Request Closure Code to ServiceNow or we can use the static content in the script directly
Note: ServiceNow Resolution code and SDP Request Closure Code must be same in order to close the Servicenow ticket.
Dynamic Content:
Static Content:
5. If the custom trigger/menu gets executed, the respective Servicenow ticket will also be closed.