Set SLA automatically for a service request using FAFR

Set SLA automatically for a service request using FAFR

Requirement:
Set SLA automatically for a service request depending on the requester site.

Usecase:
Let us consider a scenario where SLA has to be set depending on the requester's associated site.
To do this,  we need to create the required SLA list and associate it to the service request.  And then configure the below script.

Configure a FAFR > On Form Load - Applies to all requester:

setTimeout(function(){
  var requester_site = $CS.getValue("REQUESTER.SITE");
  var SLA = "Select";
  if (requester_site === "Site Mexico") {
    SLA = "SLA_ServicedeskMX_8Hrs";
  } else if (requester_site == "Site Ecuador") {
    SLA = "SLA_ServicedeskEC_8Hrs";
  } 
  jQuery('[id^=servicesla_option_]:contains("' + SLA + '")').trigger("click"); 
},400);

 $CS.getValue("REQUESTER.SITE");  >> This can be modified to any of the request fields or request additional fields, as per your requirement.

eg:
For Group:      $CS.getText("GROUP");
For Tech:         $CS.getText("TECHNICIAN"); 
For Site:          $CS.getText("SITE");
For Priority:    $CS.getText("PRIORITY");
For Impact:     $CS.getText("IMPACT"); 
For Level:        $CS.getText("LEVEL");