- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-11-2016 10:46 PM
I want to add a cc in email scripts.For this purpose i have written a email notification script as
var gr = new GlideRecord("incident");
gr.addQuery("sys_id",current.sys_id);
gr.query();
if(gr.next())
{
email.addAddress("cc",String(gr.caller), String(gr.caller.getDisplayValue()));
}
I am getting a cc field in my mail but getting the value stored database for the caller filed(it is a reference field).
How to get the name of the caller in the cc field?
Thanks in advance !!!
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-11-2016 10:54 PM
You have to do dot-walking as it is the reference field and in the cc field you should be put the email of the user -
var gr = new GlideRecord("incident");
gr.addQuery("sys_id",current.sys_id);
gr.query();
if(gr.next())
{
email.addAddress("cc",gr.caller.email.toString(), gr.caller.name.toString());
}
Mark if it is helpful or correct, feedback is appreciated
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-05-2016 11:39 PM
Hi Paradise,
If your email notification is on Requested item table , you could simply access the variables using current.variables.variable_name
If its on some other table then first get the GlideRecord object(say grRitm) of that requested item and then use grRitm.variables.variable_name
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-14-2016 02:23 AM
Hi Raveena,
Is the issue is resolved? If resolved, could you please mark the answer as correct, as it will help the community
Thanks,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2016 04:32 AM
Thanks Srikanth .I have marked it as correct answe 🙂
Regards,
Raveena Bhatia
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-21-2016 04:35 AM
Its great to know that the issue is resolved. Thanks for your feedback