How to send a report link in scheduled email execution report

GANESH23
Tera Contributor

Hi Folks,

 

need to send a report link in scheduled report execution report.

can someone please help me on this.

we are sending a report to user on sla breached. in scheduled message need to include report link too.

 

Thanks,

1 ACCEPTED SOLUTION

In that case, you can create a mail script named: linkforreport as below.

(function runMailScript(/* GlideRecord */ current, /* TemplatePrinter */ template,
          /* Optional EmailOutbound */ email, /* Optional GlideRecord */ email_action,
          /* Optional GlideRecord */ event) {
		  var instance_url = gs.getProperty('glide.servlet.uri');
template.print("<a title='Click here for report' href='"+ instance_url + "remaining URL here in quotes"' target=_blank>Click here for report</a>");
})(current, template, email, email_action, event);

 

Call the mail scrip in the message in format

${mail_script:linkforreport}

View solution in original post

5 REPLIES 5

Jaspal Singh
Mega Patron
Mega Patron

Hi Ganesh,

 

Unsure if I understand correctly but you can simply pass the URL of the report in the message field as below.

find_real_file.png

but i should display based on instance url..

In that case, you can create a mail script named: linkforreport as below.

(function runMailScript(/* GlideRecord */ current, /* TemplatePrinter */ template,
          /* Optional EmailOutbound */ email, /* Optional GlideRecord */ email_action,
          /* Optional GlideRecord */ event) {
		  var instance_url = gs.getProperty('glide.servlet.uri');
template.print("<a title='Click here for report' href='"+ instance_url + "remaining URL here in quotes"' target=_blank>Click here for report</a>");
})(current, template, email, email_action, event);

 

Call the mail scrip in the message in format

${mail_script:linkforreport}

is glide.servlet.uri is a OOB property or custom?

is mai script will use in scheduled mail execution reports?

iam sending report through scheduled job.

i dnt have idea on glide.servlet.uri. is this property contains dev3456.service-now.com link?

i have added like below

("<a title='Link' href='" + instance_url + "sys_report_template.do?jvar_report_id=655e35a1db231010e4e3f282399619e9"' target=_blank>Link</a>");

getting an error:

find_real_file.png