- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-29-2024 02:54 AM
Assignment group should not be updated more than 4 times for an incident. can anyone say how to do it?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-29-2024 06:40 AM
Hi @RIKKAL
To do this, you can use the reassignment count. If Reassignment count is above 4 show error or make Assignment group read only.
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-29-2024 06:46 AM
@RIKKAL You can create an onBefore business rule on your table as follows.
(function executeRule(current, previous /*null when async*/) {
// Ensure reassignment count exists
if (!current.reassignment_count) {
current.reassignment_count = 0; // Initialize reassignment count if not set
}
// Check if the assignment_group has changed
if (current.assignment_group != previous.assignment_group) {
// Increment the reassignment count
current.reassignment_count++;
// If reassignment count exceeds 4, throw an error and stop update
if (current.reassignment_count > 4) {
gs.addErrorMessage("The Assignment Group cannot be changed more than 4 times.");
current.setAbortAction(true); // Prevent the update
}
}
})(current, previous);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-29-2024 06:40 AM
Hi @RIKKAL
To do this, you can use the reassignment count. If Reassignment count is above 4 show error or make Assignment group read only.
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]
****************************************************************************************************************

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-29-2024 06:46 AM
@RIKKAL You can create an onBefore business rule on your table as follows.
(function executeRule(current, previous /*null when async*/) {
// Ensure reassignment count exists
if (!current.reassignment_count) {
current.reassignment_count = 0; // Initialize reassignment count if not set
}
// Check if the assignment_group has changed
if (current.assignment_group != previous.assignment_group) {
// Increment the reassignment count
current.reassignment_count++;
// If reassignment count exceeds 4, throw an error and stop update
if (current.reassignment_count > 4) {
gs.addErrorMessage("The Assignment Group cannot be changed more than 4 times.");
current.setAbortAction(true); // Prevent the update
}
}
})(current, previous);