Get the first name of the person (agent) who updates the ticket

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-23-2019 03:08 AM
Hi there,
RE: Get the first name of the person (agent) who updates the ticket
I was wondering if anyone could help with the following. (P.S. You are dealing with a complete novice here, just so you know).
We have default emails and custom replies that are sent to 'Callers' (customer). Below is a typical example: (doesn't work)
Dear ${caller_id.name}
Thank you for contacting System Admin Services.
An ticket has been opened, reference number ${number}, and automatically assigned a priority of P${priority}.
If this is a Priority 1 incident telephone the SOC immediately on +47 (0)1539 1234567 and quote the reference number.
Investigation will begin shortly and we will update you throughout the ticket life-cycle. If you would like to post further updates concerning this ticket, please reply to this message.
Regards
${u_updated_by_name}
Systems Administrator
I followed this article, then lost the plot.
In our replies, I want to include the first name of the agent who updated the ticket. I followed some documentation within 'Community', but couldn't get the name (first name) of the person who updated the ticket. ${u_updated_by_name}
I created a script as suggested;
<mail_script>
var userid = current.sys_updated_by; // Gets the User ID
var gr = new GlideRecord('sys_user'); // Creates new GlideRecord Object
gr.addQuery('user_name', userid); // Queries the table for the record of our user found in line 2
gr.query();
if (gr.next()) { // If it finds one....
var userName = gr.name; // set the variable "username" as the users name.
}
template.print("Updated By: "+userName); // Print the text "Updated By:" and then the username variable from line 7.
</mail_script>
I'm probably way off the mark. Other articles seems to suggest creating a function which references a field, like the one for 'Caller' ${caller_id.name}... However!, there's no field in my user case for the agent (person updating the ticket). If that is the case, then I guess I would need to add a field for the agent name, then hide it.
I though this would be an easy task, but finding really difficult to achieve. In a nutshell, all I want is the agents first name to be included with the signature.. Eg;
Regards,
Pierre
Systems Administrator
- Labels:
-
Incident Management

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-23-2019 06:56 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-23-2019 03:20 AM
Hi
You can try with ${caller_id.first_name}
Hope this helps.
Regards,
Omkar Mone

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-23-2019 06:47 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-23-2019 09:43 PM
Hi Pierre
Yes that way, did it help?
Regards,
Omkar Moe
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-23-2019 06:59 AM
<mail_script>
var userid = current.sys_updated_by; // Gets the User Sys ID
var userName = '';
var gr = new GlideRecord('sys_user'); // Creates new GlideRecord Object
gr.addQuery('sys_id', userid); // Queries the table for the record of our user found in line 2
gr.query();
if (gr.next()) { // If it finds one....
userName = gr.first_name; // set the variable "username" as the users first_name.
}
template.print("Updated By: "+ userName); // Print the text "Updated By:" and then the username variable from line 7.
</mail_script>
Vinod Kumar Kachineni
Community Rising Star 2022