- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-10-2018 11:36 AM
Hello, I have tried below queries but nothing seems to work. Please someone suggest me the right one. Thanks
var approvals = new GlideRecord("sysapproval_approver");
approvals.addQuery('sysapproval', current.sys_id);
approvals.addQuery('assignment_group', 'de7c36dedb90a3c838a5cae3b99619b4');
//also tried
approvals.addQuery('sysapproval_group', 'de7c36dedb90a3c838a5cae3b99619b4');
Solved! Go to Solution.
- Labels:
-
Service Catalog

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-10-2018 12:09 PM
It looks like only individuals are put into the sysapproval_approver table and it does not seem to reference what group the are a member of directly. It looks like you would need to search sysapproval_group and get the sys_id from there of what you are looking for approvals on so you can then search for the members of that group who have rejected the request in the sysapproval_approver table. Note it only looks like the table sysapproval_group table gets populated if the workflow activity of Approval - Group is used to set the approvers. The group in the sysapproval_approver table seems to be a reference to which group was set as the approver in the sysapproval_group table. Hopefully this was not to confusing as I confused myself was I was looking at the two table and testing what populated each from the workflow.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-10-2018 11:55 AM
Then you should be using the group approval table then... which is sysapproval_group.
Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-10-2018 12:09 PM
It looks like only individuals are put into the sysapproval_approver table and it does not seem to reference what group the are a member of directly. It looks like you would need to search sysapproval_group and get the sys_id from there of what you are looking for approvals on so you can then search for the members of that group who have rejected the request in the sysapproval_approver table. Note it only looks like the table sysapproval_group table gets populated if the workflow activity of Approval - Group is used to set the approvers. The group in the sysapproval_approver table seems to be a reference to which group was set as the approver in the sysapproval_group table. Hopefully this was not to confusing as I confused myself was I was looking at the two table and testing what populated each from the workflow.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-10-2018 01:40 PM
Thanks a lot for the reply Brain. This is really looks confusing to me. Can we make this simple by using addEncodedQuery by any chance? Thanks!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-10-2018 01:53 PM
I don't think so as it is crossing two tables. I think you need to query the sysapproval_group table to find the reference for the group field in the sysapproval_approver and then you can query the reference to see if there are any rejections by members of that group.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-11-2018 05:11 AM