Script to find the actual SLA of an Incident

Script to find the actual SLA of an Incident

Use case

When an incident is logged, the timer for the SLA is started. However, the actual incident might have occurred hours before the incident creation. In order to find the actual time of SLA,  we can use a python script. 

Pre-requisite 

Python should be configured in the application server along with the request module. Instructions here

Steps

1. Download the file from the attachment, extract it and place the autoclose.py under ManageEngine\ServiceDeskPlus-MSP\integration\custom_scripts

2. Make the below changes in the files

2a. configuration.json

If you already have a configuration.json given for any other script, you can ignore this. If not please proceed. 

The URL of the application and TechnicianKey should be updated. If you have not done it already, click on the user bade on the top right corner and click on API Key generation. 



2b. UpdateSLATime.py

In the application, go to Admin >> Incident - additional Fidls, note the API field name for the fields, and enter it into the script




3. Under Admin >> Custom Trigger >> Create a condition on which this action should be carried out and set the script name as below 

py UpdateSLATime.py $COMPLETE_V3_JSON_FILE or python UpdateSLATime.py $COMPLETE_V3_JSON_FILE


Save the files and test the output. 








                  New to ADSelfService Plus?