Change the Approver according to Category and sub-category
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-22-2024 12:45 AM
Change the Approver according to Category and sub-category in Change Request/ Management, Example if the Category- backup & Sub-Category-Data Domain then Approver should be XYZ like this we have more than 250 record Can you please provide the solution for it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-22-2024 12:58 AM
Hi Abhishek,
Please refer below link it might help you:-
Thanks,
Tushar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-22-2024 12:59 AM
You can write before insert/update business rule on change request table and in script you can call script include to get the approver based on category and subcategory:
below is sample template you can use:
BR:
(function executeRule(current, previous /*null when async*/) {
var category = current.category.toString();
var subCategory = current.sub_category.toString();
// Call the Script Include to get the appropriate approver
var approverScript = new ApproverAssignmentScriptInclude();
var approver = approverScript.getApprover(category, subCategory);
// Update the assigned_to field with the calculated approver
if (approver) {
current.assigned_to = approver; // Assuming assigned_to is a reference field
}
})(current, previous);
Script include:
var ApproverAssignmentScriptInclude = Class.create();
ApproverAssignmentScriptInclude.prototype = {
initialize: function() {},
getApprover: function(category, subCategory) {
// define you logic to get the approval and return
},
type: 'ApproverAssignmentScriptInclude'
};
Please Mark ✅Correct if this solves your query and also mark 👍Helpful if you find my response worthy based on the impact.
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-22-2024 01:18 AM
Hi @Ashishsk
You can make changes in Change approval policy and put these cat- sub cat as condition. but remember mate, once arrival generated, it will not be reverted until unless change move back in new state.
or if you have specific case, better use Change Model.
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]
****************************************************************************************************************