Dynamically set SLA based on field values

Dynamically set SLA based on field values

SLA for service requests needs to be set depending on the category, subcategory and priority of the request.

The possibility to modify/set SLA depending on a request Field is not available in Service Request.
Also, since SLA is an editable field, requesters can change it to their convenience.  As a result, in an organisation, automatically setting the SLA based on request fields becomes more important.

Note:  Category, Subcategory and Priority need to be populated in the request for the script to work.

Steps to configure:
1.  Download the attached scripts.  Copy the contents into Request custom functions.

2.  Goto Admin > Request Custom Function > Global Function > New > Paste the global function contents and save it with a name.
Update the URL and integration/technician key in the script. 
  1. For builds over 11300, you can get the integration key under Admin > Integrations > Integration Key > New
  2. Please use an integration key with admin privilege, as there wont be any role related permission issues. 

  3. For builds prior to 11300, refer https://help.servicedeskplus.com/api/rest-api.html$key and update the technician key.

3.  Goto Admin > Request Custom Function > Custom Function > New > Paste the Set_SLA.txt content and save it with a name
Update the global function count according to your instance

4.  Update the SLA Matrix as per your choice.  Please follow the below format.
  1. {
  2. <Category_name> : {
  3. <Subcategory_name> : {
  4. <priority_name> : <SLA_name>
  5. }
  6. }
Sample is included in the script itself.  Please follow the comments to edit the Matrix with in the script.

5.  Configure this in a custom trigger to get invoked every time a request is created. (Invoking Condition can be modified as per your requirement.)

      New to ADManager Plus?

        New to ADSelfService Plus?


              • Related Articles

              • Dynamic checklist based on field values

                Requirement: Based on the answers provided for resource questions / request additional fields, dynamically a checklist has to be associated to the request UseCase: When an alarm is received indicating an issue with a server’s performance, with the ...
              • Additional field values

                This report helps to find the picklist values in the additional fields. First you need to find the name of the table and the column holding the data, by executing the following SDP query report:  SELECT Tablename, Columnname FROM ColumnAliases WHERE ...
              • How to set due by time in a request with value from a date time additional field.

                This python script is used to set the due by date in the request based on the value that is set in a date additional field.This is performed using apis for updating a request. UseCase: Request due by time will be set based on Incident / Service ...
              • Set Task Owner depending on the request field values

                Requirement: Set Task Owner depending on the request field values. Usecase: When a task is triggered from a request, it should be assigned to a technician depending on the request field values. Steps to follow: Goto Admin > Task Custom Functions > ...
              • Dynamically add CAB based on Risk field value

                Requirement: Based on the Risk field value chosen, a set of CAB approvers have to be added to the Change UseCase: There will be different sets of CAB approvers available and when a Change is created with ‘Low/Medium’ risk a set of CAB approvers have ...