Let say there are 2 sites(Mexico and New Jersey) in an organization, user John is associated with the "New Jersey site" and Leo is associated with the "Mexico site".There are 2 service templates ("User On-Boarding" and "Remote Access to Fileserver"). Each service template are associated with 2 SLA's ("SLA_MX_8Hrs" and "SLA_NJ_8Hrs")
setTimeout(function(){
var requester_site = $CS.getValue("REQUESTER.SITE");
var SLA = "Select";
if (requester_site === "Mexico") {
SLA = "SLA_MX_8Hrs";
} else if (requester_site == "New Jersey") {
SLA = "SLA_NJ_8Hrs";
}
jQuery('[id^=servicesla_option_]:contains("' + SLA + '")').trigger("click");
},400);
>> Associate ("SLA_MX_8Hrs" and "SLA_NJ_8Hrs") in the Service template "User On-Boarding".
>> FAFR, On-Form load, copy the script to FAFR and refer to the screenshot given below.
>> Similarly when John submits the service request using the template "User On-Boarding".Based on John's site "New Jersey" the SLA "SLA_NJ_8Hrs" gets autoselected on service request.
Our previous article was on - Preventing Request Closure when there are Pending Approvals