'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

Ct111
Giga Sage

Hello, this is wrong. You cannot do approvals on POrtal without the approval_user

role. And moreover, this has license cost associated with it hence it needs to be given to only higher

people in a hierarchy like managers and all. 

 

Mark my ANSWER as CORRECT and HELPFUL if it helps

 

NOTE: for all OOB processes like Knowledge approvals/Change Approvals/Request Item approvals in order to approve it on the portal you would need this role , if you don't want to approve on the portal then maybe backend itil role will work.

Hi, in our organization, everyone can be approver, granting the role to everyone doesnt seems to be a good 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

Ankur Bawiskar
Tera Patron
Tera Patron

@tsoct 

check this KB link which talks about same issue

unless user has approver_user role they cannot update the record

[Approval Info Widget] User is not able to approve a record from Service Portal after the upgrade to...

Resolution

Possible solutions in order for the functionality to work as it was before:

1) Provide the user with approval_admin or approver_user role.
2) Clone the Approval Info Widget, modify the Server Script code (same code as before the upgrade) and add it to the Portal page.

Regards
Ankur

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader