
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2022 07:39 AM
Hi all,
I have a mail script for a mail notification where the event.parm1 refers to the sys_id of the user. Now I would like to use that data to add the *manager's* email address to CC.
What I did so far:
var gr = new GlideRecord('sys_user');
gr.get(event.parm1);
var mngr_email = gr.manager.email;
email.addAddress("cc", mngr_email, mngr);
What am I doing wrong?
Thanks and kind regards,
Cheski
Solved! Go to Solution.
- Labels:
-
Cost Management (ITSM)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2022 07:46 AM
Hey,
var gr = new GlideRecord('sys_user');
if(gr.get(event.parm1)){
email.addAddress("cc", gr.manager.email.toString(), gr.getDisplayValue("manager"));
}
Aman Kumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2022 07:43 AM
Hi,
update as this
var gr = new GlideRecord('sys_user');
gr.get(event.parm1);
var mngr_email = gr.manager.email;
email.addAddress("cc", mngr_email, gr.manager.name);
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2022 11:01 PM
Did you try this?
This should also work fine.
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-09-2022 02:18 AM
Thanks

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-06-2022 07:46 AM
Hey,
var gr = new GlideRecord('sys_user');
if(gr.get(event.parm1)){
email.addAddress("cc", gr.manager.email.toString(), gr.getDisplayValue("manager"));
}
Aman Kumar