GlideRecord in sysapproval_group
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-28-2016 08:20 AM
Hi all,
I need a requirement like this. I'm in at Group Approval (sysapproval_group) table. We all know in the related list 'Approvals', all the group members or approvers are present.
Now I need to know after query that whether the Logged in user is the one of the Approvers present in that list. For the information, in the Group Approval table the group is dynamically selected, so I'm not able to do query with a static sys_id of any particular group.
Any help will be highly appreciated!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-28-2016 08:24 AM
Why dont you directly query sysapproval_approver table with all the logged in users?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-28-2016 08:30 AM
How about this (a script of what Sumeet said)
var current = new GlideRecord('sysapproval_group');
current.get('b706a2f1134b12003c4ebdb12244b0a7');
// Check to see if the logged in user is in the approvers group of the current group approval
var isMember = false;
var app = new GlideRecord('sysapproval_approver');
app.addQuery('group', current.sys_id);
app.addQuery('approver', gs.getUserID());
app.setLimit(1);
app.query();
if (app.hasNext())
isMember = true;
gs.info('Current user is a member of this group: ' + isMember);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-28-2016 10:24 AM
Thanks folks, for your prompt reply! I am able to do that by querying in the sysapproval_approver table at last. Thanks again!