Escalate case and change Priority Business Rule
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-28-2023 12:31 PM
Hello there!
I am working with CSM, and I activate the UI action in the workspace for "Escalate a case".
I need that when this happens, the case will change to priority "2".
(I have 3 case types for which cases can be created, that's why the tables are specified in the code below)
I did the following script in a Business rule pointed to the "sn_customerservice_escalation" table , but it doesn't seem to work:
(function executeRule(current, previous) {
// Verificar si la acción se ejecuta desde el workspace
if (gs.isInteractive()) {
// Obtener el caso que se está escalando
var caseId = current.getValue('number');
// Verificar el tipo de caso y actualizar la prioridad a "2"
var caseType = current.getValue('case_type');
if (caseType == 'x_1064852_schedule_meeting' || caseType == 'x_1064852_it_manag_it_management' || caseType == 'x_1064852_exam_tak_exam_taking') {
current.setValue('priority', '2');
}
}
})(current, previous);
Any help is welcome, thanks!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-28-2023 02:00 PM
Hi Asosa,
I don't see a field named 'case_type' defined on either the sn_customerservice_escalation or sn_customerservice_case tables. That is one problem. Add:
gs.addInfoMessage("Case type = " + current.case_type);
to your script before the "if" statement and test. See what displays on the webpage when you save a sn_customerservice_escalation record.