- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-17-2024 10:37 AM
Hi Experts,
I assigned one of the incident ticket to network group and the group members are empty. When ever the assignment groups are empty. I want to restrict to submit the incident record.
Thanks in advance.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-17-2024 10:47 AM - edited 03-17-2024 10:47 AM
Hi @dhineshkumar ,
Create business rule:
(function executeRule(current, previous /*null when async*/ ) {
// Add your code here
var grpm = new GlideAggregate('sys_user_grmember');
grpm.addQuery('group', current.group);
grpm.addAggregate('COUNT');
grpm.query();
var groupMembers = 0;
if (grpm.getAggregate('COUNT')==0) {
current.setAbortAction(true);
}
}
If I could help you with your Query then, please hit the Thumb Icon and mark it as Correct !!
Thanks & Regards,
Sumanth Meda
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-17-2024 10:47 AM - edited 03-17-2024 10:47 AM
Hi @dhineshkumar ,
Create business rule:
(function executeRule(current, previous /*null when async*/ ) {
// Add your code here
var grpm = new GlideAggregate('sys_user_grmember');
grpm.addQuery('group', current.group);
grpm.addAggregate('COUNT');
grpm.query();
var groupMembers = 0;
if (grpm.getAggregate('COUNT')==0) {
current.setAbortAction(true);
}
}
If I could help you with your Query then, please hit the Thumb Icon and mark it as Correct !!
Thanks & Regards,
Sumanth Meda
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-17-2024 10:52 AM
Why not make it mandatory, and NO need to write a single line of code.
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]
****************************************************************************************************************