Escalation Process requirement
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-15-2023 09:27 PM
HI All
I have requirement where I have to write a business rule on the Task table. The requirement is like,
1, If any task is escalated then no user should be able to change the state to closed or cancelled. and also I have populated a message like "Task is already escalated".
2, On insert

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-15-2023 09:38 PM
Hi Prasnajeet,
To implement the requirements you've described, you can write a business rule on the Task table with the following script:
(function executeRule(current, previous /*null when async*/) {
//check if task is escalated
if (current.escalation && (current.state == '7' || current.state == '6')) {
current.state = previous.state; //revert state change
current.u_message = 'Task is already escalated'; //set message
}
//populate escalated for
if (current.operation() == 'insert') {
var ritmItem = current.variables.ritm_item;
if (ritmItem == 'PC Deployment') {
current.escalated_for = 'PC Deployment';
} else if (ritmItem == 'Refresh Order') {
current.escalated_for = 'Refresh Order';
} else if (ritmItem == 'Recover Asset') {
current.escalated_for = 'Recover Asset';
} else if (ritmItem == 'IMAC Request') {
current.escalated_for = 'IMAC Request';
} else if (ritmItem == 'Legal Hold Recover Asset') {
current.escalated_for = 'Legal Hold Recover Asset';
}
}
})(current, previous);
This script checks if the task is escalated and if the user is trying to change the state to closed or cancelled. If so, it reverts the state change and sets a message. It also populates the "Escalated for" field based on the value of the "ritm_item" variable for new records.
Make sure to test the script thoroughly before deploying it to a production environment.
Thanks,
Rahul Kumar
Thanks,
Rahul Kumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-18-2023 02:51 AM
HI Rahul
Thank you very much for your support on the script part. You have already explain the complete story still I have few concerns here. Please confirm on the below point. I am implementing the BR on the "OnBefore" BR and on "Update". Also i believe we can write entire script in one BR only. No need to write on multiple BR for above mentioned two scenarios. As per your script I believe it will show the display name of the catalog item not the class or sys_id.
Please confirm on all 3 point for my clarification.