addition of approver details on RITM in one comment

RamuN
Tera Contributor

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

6 REPLIES 6

Community Alums
Not applicable

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 ....!

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

Community Alums
Not applicable

 

  • 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.

 

Anurag Tripathi
Mega Patron
Mega Patron

That will be on the related list on RITM, why do do you need to add this on comment?

-Anurag