Create dynamic approval group based upon user table field?

Isaac10
Giga Expert

In our Change workflow we have an initial approval by the assignment group. It's an OOB step called Technical Approvals. Our managers are not part of their groups. They have requested:

  1. That they (the managers) be part of the group
  2. That they have the ability to choose who on their teams can approve (they may not want the entire team to be an approver)

To facilitate this we added a true/false button to the user record called: u_change_assessment_approver

How can I tell the approval to look at the assignment group and send the approval request to only those users of that group who have u_change_assessment_approver marked true?

Additionally how can I have it also send that approval to the manager of that group?

Thanks all!

1 ACCEPTED SOLUTION

dooo sorry much easier.. this is in a change workflow right?? if so do this instead in a user approval script



  1. var answer = [];  
  2. var counter = 0;
  3. var failsafe_sid = 'sid of change manager or whoever will approve if there are no active approvers';
  4. answer.push(current.assignment_group.manager.toString());   //this pushes the manager of the group to the approvers
  5. var users = new GlideRecord('sys_user_grmember');
  6. users.addQuery('group',current.assignment_group);   //find members of the group
  7. users.addQuery('user.u_change_assessment_approver',true);   //check to see if they are a change approver
  8. users.query();
  9. while(users.next()){
  10.       answer.push(users.user.toString());
  11.       if(users.user.active){
  12.                   counter++;
  13.       }
  14. }
  15. if(counter == 0){answer.push(failsafe_sid)}

View solution in original post

11 REPLIES 11

That did it!


Thank you to everyone for your help.


Taha3
Kilo Contributor

Hi Issac,

 

What if we want to send approval to any one approver selected from dropdown in Approvers list. We have a particular group where we want only one user of that group which user is selecting the approval should go only to that person.

Any help would be appreciative!

 

Thanks,

Taha