- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-22-2022 12:42 PM
I am writing a script include.
I am trying to add the Address of the user who created the request. How do I add the sys_created_by or sys_id email of the person who created the request?
if(current.getValue('u_drop_off') == '1' {
var dropOff = gs.getProperty('Location');
email.addAddress(dropOff);
email.addAddress(EMAIL OF THE USER WHO CREATED REQUEST);
}
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-22-2022 01:34 PM
If you want to send email to the requester, in the User/Group in fields, you can select the field which holds the user value.
If you want to send email with user in CC, you can use script
if(current.getValue('u_drop_off') == '1' {
var dropOff = gs.getProperty('Location');
email.addAddress('cc',dropOff);
email.addAddress('cc',current.requested_for.email);
}
Can you also confirm, your notification is on sc_request table?
Please mark this response as correct or helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-23-2022 06:13 AM
When I hard code email.addAddress('cc', ashle@test.com, 'Ashle'); It is returning in the copied field. But not dynamically based on whoever triggers the request
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-22-2022 03:05 PM
You can try out using toString() at end or do hit and trial by checking and unchecking the 'send to event creator field'. Not sure but might work.
Did you get any chance to check the actual email triggered? in that it showing in cc or not.
You should see the last few replies of the below post. It might help.
Regards,
Kartik
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-08-2023 07:48 PM
btw, email.addAddress is a scoped api. what shall we do if we work under Global scope?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-08-2023 08:17 PM
Hi,
It will work in global scope as well.
Thanks and Regards,
Saurabh Gupta