How to copy rejection comments in Service Portal to the RITM

Ramel
Mega Guru

Hi All,

Just checking if anyone has implemented copying the rejections comments from Service Portal to the RITM. Rejection comments is being copied and working if the rejection is done in the native view. But when the approver rejects in the Service Portal view, its not working. I have just made the rejection comments mandatory in Service Portal following this blog and it is working perfectly. What's left is just how to copy the comments to the RITM.

Thanks in advance.

Regards,
Ramel

1 ACCEPTED SOLUTION

Jaspal Singh
Mega Patron
Mega Patron

Hi Ramel,

 

Did you try a business rule that runs after update on the Approval (sysapproval_approver) table once Approval is rejected that copies comments to the RITM.

(function executeRule(current, previous /*null when async*/ ) {

        var v_gRITM = new GlideRecord('sc_req_item');
        v_gRITM.addQuery('sys_id', current.sysapproval);
        v_gRITM.query();
        if (v_gRITM.next()) {
            v_gRITM.comments = "Rejection Comments : " + current.comments.getJournalEntry(1);
            v_gRITM.update();
        }
       
})(current, previous);

View solution in original post

4 REPLIES 4

Jaspal Singh
Mega Patron
Mega Patron

Hi Ramel,

 

Did you try a business rule that runs after update on the Approval (sysapproval_approver) table once Approval is rejected that copies comments to the RITM.

(function executeRule(current, previous /*null when async*/ ) {

        var v_gRITM = new GlideRecord('sc_req_item');
        v_gRITM.addQuery('sys_id', current.sysapproval);
        v_gRITM.query();
        if (v_gRITM.next()) {
            v_gRITM.comments = "Rejection Comments : " + current.comments.getJournalEntry(1);
            v_gRITM.update();
        }
       
})(current, previous);

Hi @Jaspal Singh ,

I have a different issue, when ritm is rejected with rejection comment , those comments are shown in RITM but not in sys_approval_approver table. In that case your code won't work. I need to copy those to sys_approval_approver records.

Hi @ext-rishabh 

 

Did you find any solution for this issue.

 

Regards,

Jaydeep

Ramel
Mega Guru

Thanks Jaspal.