- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-14-2022 08:51 PM
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 ?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-14-2022 09:48 PM
@soumya19Tried and tested solution.
You need to add advanced reference qualifier as shown in image below
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.
ServiceNow Community Rising Star, Class of 2023
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-15-2022 09:35 AM
Thank you...! This helped me alot.