Reference qualifier on incident assignment group

soumya19
Tera Contributor

Hi,

 

I have a requirement to add reference qualifier on the incident assignment groups in with the below filters.

include Active = true

exclude type !=security groups

exclude the groups starting with "I-"

exclude the groups starting with "V-"

 

can anyone tell how to achieve this ?

1 ACCEPTED SOLUTION

jaheerhattiwale
Mega Sage
Mega Sage

@soumya19Tried and tested solution.

 

You need to add advanced reference qualifier as shown in image below

jaheerhattiwale_0-1671083199130.png

 

Script in the script include function:

getGroupQuery: function(){
var groupsNeedToBeExcluded = [];

var groupGr = new GlideRecord("sys_user_group");
groupGr.addQuery("nameSTARTSWITHI-^ORnameSTARTSWITHV-");
groupGr.query();

while(groupGr.next()){
groupsNeedToBeExcluded.push(groupGr.sys_id.toString());
}

return "typeNOT LIKEf196d9112f775110c4a0bed72799b608^ORtypeISEMPTY^sys_idNOT IN"+groupsNeedToBeExcluded.toString();
},

 

Note:

TestUtil() is script include, replace it with you script include.

Add getGroupQuery() function to your script inlcude

 

Please mark as correct answer if this solves your issue.

Please mark the answer as correct or helpful based on impact
ServiceNow Community Rising Star, Class of 2023

View solution in original post

5 REPLIES 5

Thank you...! This helped me alot.