Help with change request approval reject notification

LK11
Mega Expert

Hi,

I need to send a notification to the change requester and also all the approval groups when a change request approval gets rejected by any one of the approvers from the approval groups.  I am having 2 issues here.

1.  On 'Approval' table, I cannot pick 'requested_for'

2.  I'm using the below mailscript to display 'comments' however it's not working.

var notes;
var appr = new GlideRecord('sysapproval_approver');
appr.addQuery('sysapproval',current.sys_id);
appr.addQuery('state','rejected');
appr.query();

while (appr.next()) {
var je = new GlideRecord('sys_journal_field');
je.addQuery('element_id', appr.sys_id);
je.addQuery('elements', 'comments');
je.addQuery('name', 'sysapproval_approver');
je.query();
if(je.next()){
notes = je.value;
}

template.print('<p>Approver: ' + appr.approver.getDisplayValue() + '</p>');
template.print('<p>State: ' + appr.state + '</p>');
template.print('<p>Comments: ' + notes + '</p>');
template.print('\n');
}

Thanks

1 ACCEPTED SOLUTION

Brian Lancaster
Tera Sage

There is already an OOB notification called Change rejected.  You may just need to modify it a little as it is going to the assigned to instead of the requested for.

View solution in original post

2 REPLIES 2

Brian Lancaster
Tera Sage

There is already an OOB notification called Change rejected.  You may just need to modify it a little as it is going to the assigned to instead of the requested for.

LK11
Mega Expert

Thank you very much.  I'm fairly new to Servicenow and didn't realise that an OOB notification is existing for a change reject.  It's working fine now.