RITM Approval

Manohararuna
Tera Contributor

if one person is creating an RITM, it should NOT go for approval to same person, rather it should go for approval to others from his team for approving it. For this i want to change the workflow .How to do it 

5 REPLIES 5

Arun_Manoj
Mega Sage

Hi @Manohararuna ,

 

In workflow or flow designer please use this script

 

// Assume 'requestedFor' is the person making the request
let userID = current.requested_for;
let groupID = current.assignment_group;

let approverList = [];
if (groupID) {
let gr = new GlideRecord('sys_user_grmember');
gr.addQuery('group', groupID);
gr.query();
while (gr.next()) {
if (gr.user.toString() !== userID.toString()) {
approverList.push(gr.user.toString());
}
}
}
return approverList;