- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-07-2023 10:18 AM
I am using a clone of the 'Approvals' widget on my Service Portal homepage. The only difference between this clone and the OOB Approvals widget is line 141 in the Server Script:
data.showApprovals = true; //Changed from - gs.getUser().hasRole('approver_user'); - to allow all users to view widget
The widget is functioning as expected and showing approvals for all users just fine. The only issue is that the "Approve" and "Reject" buttons do not do anything when clicked unless you are an admin.
Other posts have suggested looking at ACLs on sysapproval_approver.state and making sure sysapproval_approver.state is not set to read-only. I have already checked these and everything looks fine there.
I'm not great at deciphering widget code and so far I have only made minor adjustments to cloned widgets, so I'm trying to understand what these buttons check for and do in the code. I'm leaning towards the "esignature" in the Client Script being the culprit but I'm not even sure what that does. Idk, I'm lost lol.
Any help would be appreciated, thank you!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-08-2023 06:25 AM
I figured it out.
So I added some debug on the $scope.approve and $scope.reject functions, and everything looked like it was checking out. I figured this must be access-related since I, as an admin, am able to use the buttons correctly. Ended up taking another look at the Server Script to see how the approvals/rejections get handled on that side, and I noticed that there's a condition when accepting the user input on line 19:
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));
if (isMine) {
app.state = input.op;
app.update();
Noticed this was similar to the code I mentioned in my original post that was affecting the visibility of the widget itself. I removed the check for gs.hasRole("approver_user") and now it works for everyone:
if (input.op == 'approved' || input.op == 'rejected') {
var app = new GlideRecord("sysapproval_approver");
if (app.get(input.target)) {
var isMine = gs.hasRole("approval_admin") || isApprovalMine(app); //changed from || (gs.hasRole("approver_user") && isApprovalMine(app));
if (isMine) {
app.state = input.op;
app.update();

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-07-2023 11:00 AM
Can you do an Inspect Element on the page to see after you click Approve to see any browser errors?
Also you should only show approvals to users to whom the approval is assigned. Make sure to test with the user whom the approval is assigned to.
Please mark this response as correct or helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-07-2023 11:07 AM
Yes, I should have included that I did watch the browser console to see what happens on click, and there is nothing in the console when you click the button. No errors or messages at all.
The widget itself is set up to only show approvals for the logged in user, and I have verified on the RITM in the photo that I am indeed the approver.
If I click on the RITM in the photo to go to the approval page (I believe it has the 'Approval - Info' widget), I am able to use the Approve and Reject buttons on that page just fine, but those functions are coded differently.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-07-2023 11:15 AM
Can you check this thread?
Did you manually create the approval like mentioned in the thread?
Also did you create the widget in global scope or in a different scope. I can't think of any other reason it not working.
Please mark this response as correct or helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-07-2023 11:23 AM
The approval is being created via workflow when a Catalog Item is submitted, so no, it is not being created manually.
And unfortunately, the widget was cloned in global.