Incident assignment group members are empty. I don't want to submit the incident record.

dhineshkumar
Tera Guru

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.

1 ACCEPTED SOLUTION

Sumanth16
Kilo Patron

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

View solution in original post

2 REPLIES 2

Sumanth16
Kilo Patron

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

Dr Atul G- LNG
Tera Patron
Tera Patron

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]

****************************************************************************************************************