- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-09-2017 01:03 PM
What I want to achieve: there are 10 groups of 2 people. I need to get at least one approval from each group. If a user is the member of several groups - he needs to approve several times.
If I add "Group Approval" activity and select these 10 groups in "Group" field - everything works as I want. If "Abel Tuter" is the member of 10 groups - there will be 10 approval records for Abel Tuter t approve/reject.
However if I select Advanced and try to query these groups - approvals are not created for most of members. Actualy I get only 1 approval record. Is there something I miss?
var answer = [];
var ApprovalGroup = 'a509e63e4f6ef200ff5fafdd0210c79c';
var gr = new GlideRecord('sys_user_group');
gr.addQuery('type,ApprovalGroup);
gr.query();
while (gr.next()) {
answer.push(gr.sys_id);
}
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-09-2017 01:09 PM
I have had a lot of success with using a User approval. It may seem counter-intuitive, but you can add an array of groups to a user approval. It may actually do what you are expecting and have multiple approvals.
Also, when you do a push, use the toString() method:
answer.push(cab.sys_id.toString());

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-09-2017 01:09 PM
I have had a lot of success with using a User approval. It may seem counter-intuitive, but you can add an array of groups to a user approval. It may actually do what you are expecting and have multiple approvals.
Also, when you do a push, use the toString() method:
answer.push(cab.sys_id.toString());
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-09-2017 01:18 PM
Very interesting ...
After I added .toString() - I get 1 approver from each group but not all approver - only 1 (I believe 1st one).
Seems that mechanism adds 1st available in alphabetic order
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-09-2017 01:26 PM
Oh, sorry - that was my fault. Another user was locked. So, converting to string did the job. Thank you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-09-2017 02:06 PM
ANDRII IARMOLATII wrote:
What I want to achieve: there are 10 groups of 2 people. I need to get at least one approval from each group. If a user is the member of several groups - he needs to approve several times.
Two questions at this point:
- is this the right way about it? If I've already approved it, I'm not sure I'd like to be asked repeatedly for the same decision because I belong to several groups.
- what you're after is a user approval, rather than group approval - you want an individual from each group to give a decision, rather than all the members, it seems.