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 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.
setTimeout(function(){
var priority = $CS.getText("PRIORITY");
var SLA = "Select";
if (priority === "Low") {
SLA = "Service Catalog SLA";
} else if (priority == "Medium") {
SLA = "Service Catalog SLA2";
}
jQuery('[id^=servicesla_option_]:contains("' + SLA + '")').trigger("click");
},400);
$CS.getText("Priority"); >> This can be modified to any of the request fields or request additional fields, as per your requirement.