How to grp.addQuery('group', 'sysid') on multiple sysid's
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2023 02:10 PM
How to grp.addQuery('group', 'sysid') on multiple sysid's
ex script
//answer = ifScript();
//function ifScript() {
// var grp = new GlideRecord('sys_user_grmember');
// grp.addQuery('group', 'sysid'); //sys_id of group assigned to Approval - Group activity ??how to add more sysid??
// grp.addQuery('user', current.variables.supervisor);
// grp.query();
// if (grp.next()) {
// return 'no';
// }
// return 'yes';
//}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2023 02:32 PM - edited 01-25-2023 02:32 PM
Hi,
Like below
grp.addQuery('group','IN','sysids') //where sysids are comma seperated sys_ids of records
Thanks and Regards,
Saurabh Gupta
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2023 05:04 PM
@Saurabh Gupta What is the 'IN" for?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2023 05:55 PM
Does not work for me it exlcudes the entire groups now and does not activate the approval that was selected by current.variables.supervisor
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-25-2023 05:23 PM
have the following script it now excludes the groups but also now does not generate the approval any ideas?
//answer = ifScript();
//function ifScript() {
// var grp = new GlideRecord('sys_user_grmember');
// grp.addQuery('group', 'IN','sysid','sysid');
// grp.addQuery('user', current.variables.supervisor);
// grp.query();
// if (grp.next()) {
// return 'no';
// }
// return 'yes';
//}