logged in user on mail template
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-03-2014 02:04 AM
Morning all.
I have set up a template on the incident table so when clicking the email icon the body contains the description as well as the name of the analyst the ticket is assigned to, their title and email address. I have had a request to change that so the signature element of the template is the person who is logged in clicking the email as its not always the assigned to person. could anyone advise what I change my script to? currently its a simple field mapping as per below.
Incident Number: ${number}
Description: ${short_description}
UPDATE
${assigned_to}
${assigned_to.title}
${assigned_to.email}
Any thoughts?
- Labels:
-
Service Mapping

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-03-2014 02:28 AM
try using something like this in body of the client template ....
<mail_script>
var uid = gs.getUserID();
var user = new GlideRecord('sys_user');
if (user.get(uid))
var userName = user.user_name;
template.print(userName);
</mail_script>
using the gliderecord (user. dot walking) you can access any field on the user record to form the signature ....
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-03-2014 02:45 AM
Heya,
Thanks for the response. I have added as per above to start with before adding the fields I want but when testing I get a blank email. screenshot below. I am on Eureka and I was told that a mail_script was working before they upgraded however the same script no longer works.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-03-2014 03:54 AM
i did try on demo and is working for me ...
this is link for the template that i created....
is the user_name field has some value for the user you tried ????
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-03-2014 05:46 AM