Join the #BuildWithBuildAgent Challenge! Get recognized, earn exclusive swag, and inspire the ServiceNow Community with what you can build using Build Agent.  Join the Challenge.

Sys Approval table field

karthik65
Tera Guru

Hi,

I need to add a dictionary field in sysapproval_approver form to populate the requested_for field value.

9 REPLIES 9

@Community Alums @Neeraj31  I have created a Notification in RITM Table . How can i retrieve the Approval comments when request is rejected. 

You copy work notes from approval table to RITM

Hi i cannot retrieve by below script.

 

var comments = new GlideRecord("sysapproval_approver");
    comments.addQuery('document_id', current.number);
    comments.query();
    if (comments.getRowCount() > 0) {
        while (comments.next()) {
            alert(curren.number);
            gs.info('Entered in email script');
            template.print(comments.getDisplayValue("Comments"));
        }
    }

var approval = new GlideRecord("sysapproval_approver");
approval.addQuery('document_id', current.sys_id);
approval.addQuery('state','rejected');
approval.query();
var data ;
while (approval.next()) {
 //   alert(current.sys_id);
    gs.log('Entered in email script');
    data = approval.comments.getJournalEntry(1).toString();
    gs.log(data.split('\n')[1]);
    template.print(data.split('\n')[1]);
}
 
try this code
 
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!

@karthik65 Try this
https://www.servicenow.com/community/developer-forum/send-approval-rejected-notification-to-requeste...

 

Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!