How to add list of approver details on RITM

Ramu8
Tera Expert

Hi Team,

 

how to add list of approvers on ritm as a single comment 

 

or anyway to inform about approver to the end user that request is pending with so on so approver 

 

please advice

7 REPLIES 7

Runjay Patel
Giga Sage

Hi @Ramu8 ,

 

Approval recors will get created based on flow configured, in the initial you will not come to know who all are in approval list but you can display the stage of ritm.

You need to configure the stage name in flow so that it will reflect on ritm as well.

 

Configure like

1. Pending with line manager.

2. Pending with IT department and so on..

 

RunjayPatel_0-1734698198799.png

 

-------------------------------------------------------------------------

If you found my response helpful, please consider selecting "Accept as Solution" and marking it as "Helpful." This not only supports me but also benefits the community.


Regards
Runjay Patel - ServiceNow Solution Architect
YouTube: https://www.youtube.com/@RunjayP
LinkedIn: https://www.linkedin.com/in/runjay

-------------------------------------------------------------------------

 

 

 

Dr Atul G- LNG
Tera Patron
Tera Patron

Hi @Ramu8 

 

Request Management/change management are modules which heavily use the flow and approvals. Not sure what is your use case to show whose approval is pending at the RITM level? It can be seen in the OOTB related list, also till the time approval not generated you cant see whose approval is pending.

*************************************************************************************************************
If my response proves useful, please indicate its helpfulness by selecting " Accept as Solution" and " Helpful." This action benefits both the community and me.

Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG
Topmate: https://topmate.io/atul_grover_lng [ Connect for 1-1 Session]

****************************************************************************************************************

Juhi Poddar
Kilo Patron

Hello @Ramu8 

 

Totally agree with @Dr Atul G- LNG  & @Runjay Patel that approval records will be created based on how the flow is configured. You cannot see all the approvers at once as it gets created sequentially.

However, you can write business rules in sys_req_item table to update the comments field with list of approvers where the state is requested.

(function executeRule(current, previous /*null when async*/) {
    // Get the list of approvers (e.g., from the approval related records)
    var approvers = [];
    var approvalGr = new GlideRecord('sysapproval_approver');
    approvalGr.addEncodedQuery("state=requested^sysapproval=" + current.sys_id);
    approvalGr.query();
    while (approvalGr.next()) {
        approvers.push(approvalGr.approver.getDisplayValue());
    }
    
    // Add approvers to the comment field on the RITM
    if (approvers.length > 0) {
        current.comments = 'Approval is pending from: ' + approvers.join(', ');
        current.update();
    }
})(current, previous);

Result:

JuhiPoddar_0-1734700084112.png

Hope this helps!

 

"If you found my answer helpful, please like and mark it as an "accepted solution". It helps others find the solution more easily and supports the community!"

 

Thank You
Juhi Poddar

Hi @Juhi Poddar 

 

you are right! as i have so many catalog items i cannot change each flow could you please suggest which br and condition