- 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-22-2022 01:48 PM
I checked 'send to created' on the notification record.
The environment is customized but is on a service portal for sure.
I am see the dropOff property being cc'd.
Now just not seeing the user also cc'd.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-22-2022 01:50 PM
Also when I preview the notification its showing me the user will be emailed. But when I check the emails in the backend im not seeing it user email in the 'copied' field
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-22-2022 02:22 PM - edited 12-22-2022 02:26 PM
Hey, If my understanding is correct, you need the the user in 'cc' who created the request.
-You need to be sure about the usage of 'send to event creator' field.
-If 'send to event creator' field is not checked, it will exclude that particular user from the email recipients even you have included him users/group or parm1, parm2.
you can also cross check the script which you have written. Arguments must be passed with the right value in addAddress() method.
e.g. -
//if you are getting value from gliderecord or by dot wallking
email.addAddress("cc", gliderec.user.email.toString(), gliderec.user.getDisplayValue());
//if values are hard coded
email.addAddress("cc", 'email address','name of the user');
To understand it more I would like to get more information on script and notification which you have configured.
you can attach the snapshots.
Hope this helps!
Regards,
Kartik
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-23-2022 09:37 AM
Thank you!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-22-2022 02:23 PM - edited 12-22-2022 02:25 PM
Hey,
If my understanding is correct, you need the the user in 'cc' who created the request.
-You need to be sure about the usage of 'send to event creator' field.
-If 'send to event creator' field is not checked, it will exclude that particular user from the email recipients even you have included him users/group or parm1, parm2.
you can also cross check the script which you have written. Arguments must be passed with the right value in addAddress() method.
e.g. -
//if you are getting value from gliderecord or by dot wallking email.addAddress("cc", gliderec.user.email.toString(), gliderec.user.getDisplayValue()); //if values are hard coded email.addAddress("cc", 'email address','name of the user');
To understand it more I would like to get more information on script and notification which you have configured.
you can attach the snapshots.
Hope this helps!
Regards,
Kartik