'Update Fail' when approving ritm from service portal

tsoct
Tera Guru

Hi all,

I cloned the 'My Approvals' widget in the Service Portal to allows users without the 'approve_user' role to action approvals.

// 1st changes on Server script

if (input.op == 'approved' || input.op == 'rejected') {
var app = new GlideRecord("sysapproval_approver");
if (app.get(input.target)) {
 //var isMine = gs.hasRole("approval_admin") || (gs.hasRole("approver_user") && isApprovalMine(app))|| (isApprovalMine(app)); //Commented this
 varisMine = isApprovalMine(app); //replaced with this

//2nd changes on server script

data.showApprovals = true;//Add this
//data.showApprovals = gs.getUser().hasRole('approver_user');//Remove this

From Service Portal widget, with the script changes above, user without role is able to approve from widget. But clicking into the RITM, approve / reject will return Update failed. 

What did I missed? 

find_real_file.png

This works:

find_real_file.png

1 ACCEPTED SOLUTION

Anil Lande
Kilo Patron

Hi,

I believe both widgets are different, did you check 'Approval Info' widget?

You need to modify it and make required changes and test again.

 

Thanks,

Anil Lande

Please appreciate the efforts of community contributors by marking appropriate response as correct answer and helpful, this may help other community users to follow correct solution in future.
Thanks
Anil Lande

View solution in original post

6 REPLIES 6

GSReddy1
Tera Contributor
Have you got the solution for this update error,if yes share in detail what all the modifications we need to to

Govi
Tera Contributor

Yes, I have implemented it as well, Please see the Link shared by "Ankur Bawiskar"