Missing Ref:MSG string in approve email

Kiff
Giga Expert

Missing the Ref:MSG string in my email hence the request does not get approved when button is clicked. How can i fix this issue and where do i look? The "omit watermark" box is unchecked.

var _waterMark = '';
var gr = new GlideRecord('sys_watermark');
gr.addQuery('source_id', current.sys_id);
gr.query();
if(gr.next()) {
_waterMark = gr.number.toString();
}
var link = "mailto:"+gs.getProperty('instance_name')+"@service-now.com?subject=Re:"+current.sysapproval.getDisplayValue()+" -approve&body="+_waterMark;

Thanks.

1 ACCEPTED SOLUTION

Kiff
Giga Expert

Made changes to the mail script and it is now working correctly

var _waterMark = '';
var gr = new GlideRecord('sys_watermark');
gr.addQuery('source_id', current.sys_id);
gr.query();
if(gr.next()) {
_waterMark = gr.number.toString();
}
var link = "mailto:"+gs.getProperty('instance_name')+"@service-now.com?subject=Re:"+current.sysapproval.getDisplayValue()+" -approve&body="+email.waterMark;

View solution in original post

3 REPLIES 3

Tony Chatfield1
Kilo Patron

Hi, what are the results of your debugging?
If I recall correctly I belive that the watermark is created\applied at the end of the outbound email process and cannot be referenced via mail_script, as it doesn't exist when mail_script runs.

You are right. It is applied at the end of the outbound email and I also believe it should be automatically included in the email when a user clicks the approve or reject link/button. Just wondering why this isn't included in my approve button email body.

Kiff
Giga Expert

Made changes to the mail script and it is now working correctly

var _waterMark = '';
var gr = new GlideRecord('sys_watermark');
gr.addQuery('source_id', current.sys_id);
gr.query();
if(gr.next()) {
_waterMark = gr.number.toString();
}
var link = "mailto:"+gs.getProperty('instance_name')+"@service-now.com?subject=Re:"+current.sysapproval.getDisplayValue()+" -approve&body="+email.waterMark;