addition of approver details on RITM in one comment
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-20-2024 04:15 AM
Hi Team,
how to add list of approvers on RITM in a single comment
or anyway to inform about approver details to the end user that request is pending with so on so approver
please advice
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-20-2024 04:25 AM
Hi @RamuN ,
To add a list of approvers to a Request Item (RITM) in ServiceNow as a single comment, or to inform the end user about the approver details (e.g., who the request is pending with), you can follow one of these approaches:
1. Adding a List of Approvers in a Comment
You can use a Business Rule or Scripted Flow to dynamically collect and add the approvers to a comment field. The approvers can be fetched from the sysapproval_approver table, which tracks approvers for RITMs.
Steps:
- Script to Add Approvers to a Comment:
You can write a script in a Business Rule or Scripted Flow that gathers the approvers for the RITM and then adds them to a comment field (e.g., work_notes or a custom comment field).
// Get the RITM record
var ritm = new GlideRecord('sc_req_item');
ritm.get('<RITM_sys_id>'); // Replace with actual RITM Sys ID
// Get the approvers from sysapproval_approver table
var approvers = [];
var approverGR = new GlideRecord('sysapproval_approver');
approverGR.addQuery('document_id', ritm.sys_id);
approverGR.addQuery('state', '!=', 'approved'); // Exclude already approved
approverGR.query();
// Collect approver names
while (approverGR.next()) {
approvers.push(approverGR.approver.name);
}
// Create a comment string
var approverList = 'The following approvers still need to approve your request: ' + approvers.join(', ');
// Add the approvers list to the RITM work notes
ritm.work_notes = approverList;
ritm.update();
Hi @RamuN ,i have tried on my PDF . it works. please try this ....!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-20-2024 04:37 AM - edited 12-20-2024 04:40 AM
hi @Community Alums
Thanks for quick response but which BR(async or after) and trigger condition ?
actually here i used async BR on approver table and also one check box with sleep time as 2 mins but not working it is working only for first time but second it is updating multiple times when multiple approval records
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-20-2024 04:46 AM
- Use an After Business Rule to pause and resume SLAs when the state is "Awaiting Approval."
- To inform users about the approvers, you can add a list of approvers to the RITM's comments or work notes using a Business Rule.
- You can also notify the end user via an email notification, showing them who the current approvers are.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-20-2024 04:33 AM
That will be on the related list on RITM, why do do you need to add this on comment?