Email notification empty values
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-15-2016 04:45 AM
Looking for some assistance on an issue with blank emails.
Created 2 new tables as extensions of the Task table and they are CCR (a specific type of request) and CCT (any tasks associated with that request).
The requirement is to send an email notification to the CCR requester, 3 days after a specific CCT task state changes to Pending.
A client script has been configured to set a reminder date field on that CCT, whenever the state changes to Pending.
Created a scheduled job to run periodically (for testing purposes currently set to every 10 min) and when the conditions within the script are met, it triggers an event and sets a reminder sent flag on the CCT.
The event runs on the CCR table and is being used to send an email notification to the requester.
The notification is running against the CCR table and is correctly sent to the requester when the conditions are correct, using an email template.
This template is also using the CCR table.
The issue experienced is that information is missing from the email message being sent.
The number and opened_at fields are empty within the email message sent.
The URI_REF ends up pointing to the scheduled job and not the actual CCR.
Also tried leaving the email template empty and have it call an email script, but the number and opened_at are also blank within the email sent.
We are on Fuji Patch 13 Hotfix 1.
Any ideas on what the issue may be and the best approach to achieving the requirements, are greatly appreciated?
As always, any assistance is greatly appreciated.
Cheers,
Ron

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-15-2016 06:49 AM
JSON has it's uses for passing complex information via a string - I use it mostly in integrations.
current and parent objects are not available in scheduled jobs (business rules, yes, but that's different.) You can pass any GlideRecord record as the second argument. Since you were using parent and then put that in to ccr, it looked like the right thing to pass.
Is the table on the notification also u_ccr (just to ensure consistency.)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-15-2016 07:09 AM
Correct, u_ccr is the table for the notification.
One thought that came to mind is that I'm calling an event that runs against the u_ccr table from the scheduled job, but I'm calling it from within a query on a u_cct record. Is it possible the system is confused by utilizing both tables?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-15-2016 07:15 AM
Shouldn't be. It's a similar situation with approvals and tasks. When possible, stick with the same table for our queries, events, and notifications and dot-walk to the information you need.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-15-2016 04:55 AM
Why dont you do a GlideQuery in the email script-
example-
var grReq = new GlideRecord("sc_req_item");
grReq.addQuery("sys_id", current.sysapproval);
grReq.query();
while(grReq.next()) {
var number = grReq.number;
var user = grReq.requested_for;
var shortD = grReq.short_description;
var openBy = grReq.opened_by;
var sys = grReq.sys_id;
}
You can use the values in the script-
email.setSubject("Request Item : "+number+" for "+user.name+" requires your approval");
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-15-2016 06:26 AM
Thanks Manoj.
I've updated the variables accordingly and tried your recommendation, but I'm getting the following for the subject line:
"Request: undefined for system requires your approval"
Any thoughts?