Dynamically set SLA based on field values

Dynamically set SLA based on field values

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

Usecase:
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 ADSelfService Plus?

                    • Related Articles

                    • Send escalation email to the Technician "Reporting to" if SLA is violated (Deluge).

                      From Builds 10600 and above Follow the below steps and based on the update we need to create a custom trigger based on the action set under the SLA escalation notification and then with the help of that we can execute the custom trigger and the ...
                    • To make SLA mandatory while creating a service request

                      The steps mentioned below make the SLA selection mandatory for any service request creation. Tested in builds : 14000 and 14301. Script: if(!jQuery("#servicesla-selected").attr("data-association-id") || ...
                    • Set SLAs based on criteria with different ETAs for different accounts.

                      This can be categorized based on the templates associations of accounts and having the SLA's pre-defined already 1. Pre-define SLAs with different ETAs. 2. Go to Admin > Service Catalog > Field & Form Rules > On Feild Change > Set "Selected ...
                    • Set SLA automatically for a service request using FAFR

                      Note: The below FAFR script will work only on 10600 MSP and above Requirement: Set SLA automatically for a service request depending on the Priority. Usecase: Let us consider a scenario where SLA has to be set depending on the requester's associated ...
                    • 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 ...