Need help on how to create an additional approval outside of the workflow. (manual request approval)

Julie Catano
Kilo Guru

I'm looking for a way to manually trigger another approval request outside of the workflow.  The requirement is when a sctask is assigned to an assignment group and they need additional approvals on this RITM.  Under the approval tab on the RITM I can see under the drop down "Actions on selected rows" Request approval.  How is this function used, is it like doing an ad hoc approval? and I'm an admin and it's grayed out for me.  (see screen shots)

1 ACCEPTED SOLUTION

Hello @Julie Catano ,

 

Kindly Update your BR with the following details, It will achieve your requirement. Write Before Insert Business rule

 

Sunny3008_0-1693371441967.png

 

 

Before insert business rule

Table: sysapproval_approver
Condition: current.sysapproval.sys_class_name=='sc_req_item'

Script: 
(function executeRule(current, previous /*null when async*/) {
//current.state='requested';    // If you want to add approval as requested state initially add this line otherwise ignore
	// Add your code here
	var gr=new GlideRecord('sc_req_item');
	gr.get(current.sysapproval.sys_id);
	gr.approval='requested';
	gr.update();

})(current, previous);

 

 

Please mark this as correct answer and helpful if it resolved, or mark this helpful if this help you to reach towards solution.

 

View solution in original post

8 REPLIES 8

Jaspal Singh
Mega Patron
Mega Patron

Hi Julie,

 

As a suggestion, why not create a UI Action: Adhoc Approvals & make it available to the required team. If they need they can click on this button & the button will hold underlying logic that will create an Approval record.

Sunny15
Tera Guru

Hello @Julie Catano ,

 

Kindly follow the below mentioned steps to add manual approval.

 

1.Right click on any field in related list of approval tab then go to configure and then to list control.

Sunny15_1-1692987063020.png

 

2. After opening of this page kindly verify omit edit button is unchecked, If it's checked, uncheck that and save the changes.

 

Sunny15_3-1692987234653.png

 

3. After saving configuration verify edit button on related list is visible.

Sunny15_4-1692987275436.png

 

4. Click on Edit button and add user whom you want select as approval, Then that user will dispay on the list in 'Not yet requested' state

Sunny15_5-1692987311008.png

 

5. Click on check box in first column of list the that user(Row) will be selected.

Sunny15_7-1692987331636.png

6. Then Click on the dropdown "Action on selected row" and select the action 'Request Approval' So state will be change to 'Requested' and manual approval will trigger successfully.

Sunny15_8-1692987368952.png

 

Kindly let me know if there is any question.

 

Thanks,

Sunny R

 

 

I like this solution, but do I have to have a Business Rule to trigger the approval table so that he RITM state will change to waiting approval?  If so, do you have the code for the BR that would do this?

@Julie Catano ,

did you try my solution it works in BR , let me know if you have any issue 

Please mark this as helpful and accept as a solution if this resolves your Ask.
Regards,

Shyamkumar