- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-02-2016 11:40 PM
Hi guys!
I am struggling with an approval in a workflow.
So, I want to send an approval to a group, based on what division (company) that group belongs to (the company is referenced in a field on the sys_user_group-table; u_vendor).
I am trying to accompling this with a script in the Approval - Group action in the workflow, but the approval just won't get sent.
I have tried several varieties of the script, and the script runs correctly, but the approval won't send..
The "masterpiece":
var gr = new GlideRecord('sys_user_group');
var div = current.u_division.sys_id;
var group;
var answer =[];
gr.addQuery('u_vendor', div);
gr.query();
gs.log('Current division: ' + div);
gs.log('Records returned: ' + gr.getRowCount());
if(gr.next()){
group = gr.sys_id;
answer.push(group.toString());
gs.log('group: ' + group);
gs.log('answer: '+ answer);
}
From System Log
How can I get this to work?
Thanks!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-03-2016 12:07 AM
The script is perfect. I tried it (changing some variables) and it worked fine. Does the approval group has members?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-03-2016 12:07 AM
The script is perfect. I tried it (changing some variables) and it worked fine. Does the approval group has members?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-03-2016 12:30 AM
Hi!
Thanks! I was 100% sure that the groups had members, but when I double checked, they were empty..
Rookie mistake!
Thanks again!