- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2024 07:31 AM
Hi All,
I have a requirement where i need to send the notification to the users who update the incident. We have a email script which is already defined and is fetching the email instead of the name .
reference image :
I did write the email script to fetch the name instead of the email :
But this isn't fetching the name
How to achieve this?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2024 07:38 AM
Hi @phr
Please change your email script to the one like below.
var usrGr = new GlideRecord("sys_user");
usrGr.addEncodedQuery("user_nameSTARTSWITH" + current.sys_updated_by);
usrGr.query();
if(usrGr._next()){
template.print(usrGr.getValue('name'));
}
Please mark my answer helpful 👍 and accept as a solution ✔️ if it helped.
Anvesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2024 07:48 AM - edited 08-01-2024 07:59 AM
You don't have 2 mail scripts with that name?
Add a gs.log(); on line 2 and 8 of your mail script.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-01-2024 08:56 AM
Hi @LorenzVdV ,
One was "updatedby" and the other was the custom client script "getUpdatedBy" which wasn't working fine.
I modified the code now and is working fine.
Thank you,