- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-09-2017 04:54 PM
Hello
We are on Jakarta. I have a need to filter out IP address which starts with 172.
How can I add to my query? Any help on syntax would greatly appreciated.
rec.addQuery('ip_address', 'STARTSWITH','172.'); ( I want to add query like this but with negation i.e. Does not Starts with)
Thanks,
Rajan Mehta
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-10-2017 07:56 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-26-2018 02:31 AM
Hi Rajan,
I had requirement to restrict specific groups(prefixes was given which we need to eleiminate) to restrict for specific users and i wrote below code
(function executeRule(current, previous /*null when async*/) { var group_prefix = gs.getProperty('GroupPrefixes'); // replace with your system property var group_splitted = group_prefix.split(','); var query = 'nameSTARTSWITH'+group_splitted[0]; for(var i=1;i<group_splitted.length;i++){ query = query+"^ORnameSTARTSWITH"+group_splitted[i]; } var final_groups =[]; var allGroups = new GlideRecord('sys_user_group'); allGroups.addEncodedQuery(query); allGroups.query(); while(allGroups.next()){//final_groups.push(allGroups.sys_id); current.addQuery('sys_id','!=',allGroups.sys_id); // this will eliminate those groups }
|
Regards
Anantha Gowraram