Create email notification on sysapproval_approver table

Lydon
Mega Expert

Hello

 

on the change request form, given that the change is in the authorized state

User selects the approver tab on the related list and clicks on requested then changes the state to rejected and enters comment on the mandatory comment section

I will like and email notification to be sent out to the CAB Approval

 

Email should say

 

 

Subject: CHGXXXXX requires more information to be approved.

 

Please do not respond to this email 

 

Type: Should populate from the CR

Service: Should populate from the CR

Planned start date: Should populate from the CR
Planned End date: Should populate from the CR
 
Click here to view the change request  (the change request should be hyperlink)
 
I am not sure how to message part especially since these variables are not on the list of available variables  
 
Lydon_0-1674840145610.png

 

 
1 REPLY 1

Prasad Dhumal
Mega Sage
Mega Sage

Hello Lyden,

Configure After-Update Business Rule.

Setup event and notification.

 

Refer below pseudocode:

var change = new GlideRecord('change_request');
change.get(current.sys_id);

var subject = 'CHG' + change.number + ' requires more information to be approved.';
var type = change.type;
var service = change.u_service;
var start_date = change.start_date;
var end_date = change.end_date;
var link = 'https://your_instance.service-now.com/nav_to.do?uri=change_request.do?sys_id=' + change.sys_id;

var message = 'Type: ' + type + '<br>' + 
              'Service: ' + service + '<br>' + 
              'Planned start date: ' + start_date + '<br>' + 
              'Planned End date: ' + end_date + '<br>' + 
              '<a href="' + link + '">Click here to view the change request</a>';

gs.eventQueue('email.send', 'cab_approval@your_company.com', '', subject, message, '', '', '', '');

 

Regards

Prasad