- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-18-2024 09:00 PM
Hi Team ,
while clicking on the emoji , coming as undefind
(function runMailScript( /* GlideRecord */ current, /* TemplatePrinter */ template,
/* Optional EmailOutbound */
email, /* Optional GlideRecord */ email_action,
/* Optional GlideRecord */
event) {
gs.log("current " + current.number, 'sys');
var surv = new GlideRecord('asmt_assessment_instance');
surv.addNotNullQuery('trigger_id');
surv.addQuery('trigger_id', current.sys_id);
surv.query();
surv.next();
gs.log("Incident from survey " + surv.number, 'sys');
var params = current.number + "," + surv.number;
//var subject = "survey:" + surv.number + " " + " " + "incident:" + current.number + " ";
var subject = "Reminder:Please share your feedback on " + "Incident: " + current.number;
//+ " " + ": Survey Number : " + surv.number;
email.setSubject(subject);
template.print('<a href="' + gs.getProperty('glide.servlet.uri') + '/sp?id=take_survey&instance_id=' + surv.sys_id + '"><img src="CSAT.png" width="280" height="55"/></a>');
})(current, template, email, email_action, event);
This is the email script , what will be error can anyone please help me here .
How to sort it out .
Thanks in adavance
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-22-2024 12:15 AM
Hi @nameisnani ,
I believe same script was shared on another thread and that resolved your issue.
Could you please close this question by marking appropriate solutions as correct answers?
Thanks
Anil Lande

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-19-2024 01:18 AM
Hi,
Please try below:
sendNotification();
function sendNotification() {
try {
var gr = new GlideRecord('asmt_assessment_instance');
gr.addEncodedQuery('metric_type=64e7c28d8794b190158285d50cbb3547^state=ready^due_dateRELATIVELT@dayofweek@ahead@7^u_reminder_sent=false');
gr.query();
while (gr.next()) {
gs.eventQueue('send_reminder_survey', gr.task_id.getRefRecord(), gr.user, ''); //
gr.u_reminder_sent = 'true'; // u_reminder_sent is a Boolean field
gr.update();
gs.log('Testing');
}
} catch (ex) {
gs.info(ex);
}
}
Thanks
Anil Lande
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-19-2024 01:20 AM
@Anil Lande trying.....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-19-2024 01:22 AM
I have updated the schudle job
Please confirm notification is should be on incident table or assesment table ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-19-2024 01:27 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-21-2024 09:08 PM
Hi,
In Above notification it was sent for Incident INC0039217.
Check assessment table and make sure there is an assessment available for this incident.
In your Email Script, the glideRecord query is not returning any assessment record.
Thanks
Anil Lande