In ESC my task widget when rejecting approval puts comment on RITM instead of Approval record

suhaibs
Tera Contributor

In the ServiceNow Employee Self-Service (ESS) My Task widget, when an approval is rejected, the entered comment is added to the RITM record instead of the Approval record

 

suhaibs_0-1737906758857.png

suhaibs_1-1737906793904.png

 

suhaibs_2-1737906854519.png

suhaibs_3-1737906901762.png

 

 

2 ACCEPTED SOLUTIONS

Twinkle S
Mega Sage
Mega Sage

Hi @suhaibs , 

This is OOB behavior. But to do the same you can write Before insert/Update BR on RITM Table Like below:

Condition: additional comments changes!

 

var gr = new GlideRecord("sysapproval_approver");
    gr.addQuery("document_id", current.sys_id);
    gr.query();
    if (gr.next()) {
        gr.comments = current.comments;
        gr.update();
    }
 
This will work as I tested it in PDI.
 
If you feel this was helpful, please consider giving thumbs up and if it solved your issue, please mark this correct.
Thanks

View solution in original post

To avoid copying the comments from RITM to Approval record , you can add condition like below

twinkle4_0-1737979329131.png

 Reason for rejection is automate text prefix which appears on the ritm comments once the approval is  rejected! Just tried this and it works . Only when the approval is rejected the comments appear on the approval record.

If you feel this was helpful, please consider giving thumbs up and if it solved your issue, please mark this correct.
Thanks

 

View solution in original post

8 REPLIES 8

Twinkle S
Mega Sage
Mega Sage

Hi @suhaibs , 

This is OOB behavior. But to do the same you can write Before insert/Update BR on RITM Table Like below:

Condition: additional comments changes!

 

var gr = new GlideRecord("sysapproval_approver");
    gr.addQuery("document_id", current.sys_id);
    gr.query();
    if (gr.next()) {
        gr.comments = current.comments;
        gr.update();
    }
 
This will work as I tested it in PDI.
 
If you feel this was helpful, please consider giving thumbs up and if it solved your issue, please mark this correct.
Thanks

Thanks for the suggestion 

 

But the problem in this solution is that it simply triggers whenever the RITM comments change, it could lead to a situation where any comment added to the RITM is copied to the Approval record. This could be problematic if you only want the comments to sync when there is a rejection or another specific approval action, rather than on every change to the RITM's comments

 

The reason I raised this question is that whenever an approval is rejected from the MyTask widget, an approval rejection email is sent, but the comment field remains empty. This happens because when a user rejects the approval, the comment is added to the RITM record instead of the Approval record

To avoid copying the comments from RITM to Approval record , you can add condition like below

twinkle4_0-1737979329131.png

 Reason for rejection is automate text prefix which appears on the ritm comments once the approval is  rejected! Just tried this and it works . Only when the approval is rejected the comments appear on the approval record.

If you feel this was helpful, please consider giving thumbs up and if it solved your issue, please mark this correct.
Thanks

 

Hey, could you confirm if this solves your problem? 

Let me know!

 

 

If you feel this was helpful, please consider giving thumbs up and if it solved your issue, please mark this correct.
Thanks