Approval to be sent to manager of specific group from workflow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-06-2020 10:02 PM
Hi all,
My requirement is to send approval to the manger of group 'Service now support team' from workflow.
I tried creating approval user activity and gave there assignment_group.manager and selected assignment group but it is sending approval to whole group instead if sending it to manager.
please suggest.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-06-2020 11:21 PM
this piece of code should be in approval user activity or approval group activity?and where should i define the group name because approval should trigger to manager to Data Governance Hub group.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-06-2020 10:21 PM
Hi karishma
try following script
var answer = [];
var group = new GlideRecord('sys_user_group');
group.addQuery('sys_id','<group sys id>');
group.query();
if(group.next()){
var mgrID = group.manager;
answer.push(mgrID.toString()); //push manager
}
If it help mark helpful or correct.
Thanks and regards
Anil
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-06-2020 11:22 PM
this piece of code should be in approval user activity or approval group activity?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-06-2020 11:27 PM
Hi,
var answer = [];
var group=current.
var group = new GlideRecord('sys_user_group');
group.addQuery('sys_id',<GROUPS_SYSID);
group.query();
if(group.next()){
answer.push(group.manager.toString()); //Push sys_id of the manager in the answer variable.
}
}
Thanks
Sudhanshu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-10-2020 01:12 AM
this piece of code should be in approval user or approval group activity?