Adhoc Approvers

avinash21
Mega Contributor

Hi

What are the diff   ways in which Adhoc Approvers can be added   in Servicenow.

TIA

1 ACCEPTED SOLUTION

Here's a snippet from a workflow I used to add an optional Manual Approver stage just ahead of CAB approval.


manual approves in workflow.PNG



The standard workflow activity Manual Approvals can be dragged on to any workflow. This ensures if there are any manual approvers, and their approval has been requested, that the workflow doesn't proceed until they have all approved. (Or perhaps only one of them needs to approve. That's an option you can set from inside the WF actvity block.)



I have also used a Run Script block ahead of Manual Approvals to give the process a little kick. Normally, a user has to right-click and choose the Request Approval UI Action for each manually added approver. The script looks for any approvals in state Not Requested, and changes the state to Requested, so it saves a few clicks. Also users expect when they hit the Request Approval button at the top, the approval emails are sent automatically. Script below.



var chgId = current.sys_id;


var gr = new GlideRecord('sysapproval_approver');




gr.addQuery('sysapproval', chgId);


gr.addQuery('state','not requested');


gr.query();


var i = 0;




while (gr.next())


{


      gs.log("Requesting approval for manually added approvers: "+ i +


      ' ' + gr.approver.getDisplayValue());


  gr.state = 'requested';


  gr.update();


  i++;


}




As Harish points out above, you could also bring the Manual Approval activity inside an Approval Coordinator block. It will work just the same.


View solution in original post

11 REPLIES 11

harishdasari
Tera Guru

Hi Avinash,



You can design a workflow where you can add adhoc approvers. here you can include Approval groups, Maunal Approvals, approval users. This is the best way to add the approvals.


find_real_file.png



Thanks, Hope this is helpful


I guess the question was more on how to get them into the process



We have used an approach like this:


- Create new field on record (e.g. change_request)   to enable adding of ad-hoc approvers


- within workflow have an approval activity which adds the ad-hoc mentioned users to the approval list (some scripting required)


Here's a snippet from a workflow I used to add an optional Manual Approver stage just ahead of CAB approval.


manual approves in workflow.PNG



The standard workflow activity Manual Approvals can be dragged on to any workflow. This ensures if there are any manual approvers, and their approval has been requested, that the workflow doesn't proceed until they have all approved. (Or perhaps only one of them needs to approve. That's an option you can set from inside the WF actvity block.)



I have also used a Run Script block ahead of Manual Approvals to give the process a little kick. Normally, a user has to right-click and choose the Request Approval UI Action for each manually added approver. The script looks for any approvals in state Not Requested, and changes the state to Requested, so it saves a few clicks. Also users expect when they hit the Request Approval button at the top, the approval emails are sent automatically. Script below.



var chgId = current.sys_id;


var gr = new GlideRecord('sysapproval_approver');




gr.addQuery('sysapproval', chgId);


gr.addQuery('state','not requested');


gr.query();


var i = 0;




while (gr.next())


{


      gs.log("Requesting approval for manually added approvers: "+ i +


      ' ' + gr.approver.getDisplayValue());


  gr.state = 'requested';


  gr.update();


  i++;


}




As Harish points out above, you could also bring the Manual Approval activity inside an Approval Coordinator block. It will work just the same.


Hi Richard,



As you mentioned it depends upon the requirement we can use Run script, here vinay didn't mentioned his requirement and asked what are the ways for adhoc approvals, so I mentioned him to design a workflow and use the Approval coordinator activity. I accept that you have mentioned is also right, But again it depends upon the requirement. we have designed some workflows exactly same what you have mentioned using run script activity.



Thanks.