How to get "updated by " name in the notifications?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-23-2017 03:48 AM
By using this " ${sys_updated_by} " i'm getting the user id of the user in the notifications.
But i want updated User name not the user id, can any one knows how can we achieve this?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-23-2017 03:57 AM
use can solve this by using email script
add this to notification
${mail_script:updated_by}
create a mail script by name me updated_by
(function runMailScript(/* GlideRecord */ current, /* TemplatePrinter */ template,
/* Optional EmailOutbound */ email, /* Optional GlideRecord */ email_action,
/* Optional GlideRecord */ event) {
var gr = new GlideRecord('sys_user');
gr.addQuery('user_id',current.sys_updated_by);
gr.query();
while(gr.next())
{
template.print(gr.name);
}
})(current, template, email, email_action, event);
We are employing this method as updated by field is of type string
Please like or mark correct based on the impact of response.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-23-2017 04:12 AM
Thank you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-23-2017 05:54 PM
Hi,
You can use mail script,
1 - Put this in the notification HTML :
${mail_script:getUpdatedBy}
2 - Add a new mail script with the name getUpdatedBy and paste this code in script field :
(function runMailScript(current, template, email, email_action, event) {
var gr = new GlideRecord('sys_user');
gr.get(current.sys_updated_by);
template.print(gr.name);
})(current, template, email, email_action, event);
Regards,
Otmane
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-08-2023 07:07 AM
use this script its working for me
var gr = new GlideRecord('sys_user');
gr.addQuery('user_name',current.sys_updated_by);
gr.query();
if(gr.next()){
template.print(gr.name);