Why does todos_approval_actions save the comment tot the target record?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-12-2022 07:34 AM
While working on some issues with approval-comments, we noticed that when end-users approve / reject a request using ESC, the comments are directly saved to the target record.
This is different from when a request is approved / rejected from the platform UI, where the comment is saved in the sysapproval_approver-table.
I'm a bit confused as why there is a difference between these two methods.
What we observe
Action: End user rejects approval for a RITM (sc_req_item) using ESC via the todos_approval_actions widget
Result: The sysapproval_approver record is changed to state = rejected. The comment is added to the sc_req_item-record.
Action: User rejects approval using the platform UI on the same RITM (sc_req_item)
Result: The sysapproval_approver record is changed to state = rejected AND the comment is added to that record. A business rule than copies the comment to sc_req_item.
But why? Why is the comment by default added to the target record, and not to the sysapproval_approver table?
This seems to also complicate ACL's on every target table, as todos_approval_actions uses GlideRecordSecure to save the comment.
- 1,556 Views

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-14-2022 09:07 AM
Same! I even opened a HI case for this. I had to develop some workaround for this, but the response from SN was that this is will be resolved in San Diego. We haven't upgraded yet so I cannot confirm.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎07-18-2022 09:34 AM
Can you provide the workaround for it? Did you have to create any ACLs for Approver users to provide access to write comments in Req Item table?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-04-2022 08:25 AM
So, we're on the San Diego release, but the issue is not resolved on that release. I even tried a fresh developer instance, but to no avail.
We ended up making two changes to the service portal widget "Todos Approval Actions".
These changes ensure that comments are written to sysapproval_approver, instead of the target record.
The changes as follows:
Under Server script in the function updateApprovalAndComment, we changed the following lines:
FROM:
commentGr.comments = gs.getMessage('Reason for rejection: {0}', request.comments);
commentGr.update();
TO:
approvalGr.comments = gs.getMessage('Reason for rejection: {0}', request.comments);
So we changed "commentGr" to "approvalGr" and removed the call to .update(), since the update is called later for approvalGr.
We made this change 2 times: for rejection and a few lines later for approval as well.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-16-2022 05:00 AM
Works great!