Skip approval if opened by an assignment group
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-27-2025 01:14 PM
I am working on a catalog item, and the requirement is to skip approval if it is opened by a certain assignment group. Could someone help me with the script for the If activity on the workflow.
Thank you.
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-27-2025 03:12 PM
Hi @Jen11,
Try the following, note that you need to replace {sys_id of group} with the sys_id of your group.
answer = ifScript();
function ifScript() {
var memberGr = new GlideRecord('sys_user_grmember');
memberGr.addQuery('user', current.getValue('opened_by'));
memberGr.addQuery('group', '{sys_id of group}');
memberGr.query();
if (memberGr.getRowCount > 0) {
return 'yes'; //user is a member of at least one or more groups
}
return 'no';
}