How to pull caller's name in an Incident Template
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-28-2022 10:30 AM
I have been working with a team to try and work out how to pull the first and last name of the person who put in an Incident ticket. In this case, we'll say the user's name is Jane Smith. I create a template, and under additional comments I put in the following:
javascript:gs.getCallerID()
The result is undefined. I am only able to automatically fill in my name by using gs.getUserDisplayName(), my guess is glide system only works on client-side calls. Is it even possible to use templates to pull the caller's name?
Thanks!
- Labels:
-
Facilities Service Management

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-28-2022 10:53 AM
Hello,
The GlideSystem API is server side and getCallerID is not a correct method or at least one I've ever seen or heard of. I'd recommend reviewing documentation such as this for assistance: https://servicenowguru.com/scripting/user-object-cheat-sheet/
If you're trying to set the caller field right to the user using the template, then you'd use:
gs.getUserID()
For other things like first name, last name, you'd use things like: getFirstName() and getLastName().
All of this would pull from the current user's session.
If you're trying to set field values defaulting the user who put in the ticket, then you'd want to address this in the record producer (where the end-user puts it and set the default value to them) or something along those lines.
Please mark reply as Helpful/Correct, if applicable. Thanks!
Please consider marking my reply as Helpful and/or Accept Solution, if applicable. Thanks!