Can I apply a variable in an Incident or Change template?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2017 02:33 AM
Hello,
I was wondering if it is possible to apply variables in a certain template?
In detail, that would mean for e.g solving an Incident I create a template with the appropriate state and so on.
Then I would like to fill in the field Additional Comments with the text:
Dear "CALLER"
We have resolved the incident.
And Caller should be the name from the current record.
Is this possible somehow?
- Labels:
-
Customer Service Management
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2017 02:42 AM
Yes it is possible with client scripts.
So, if you change the state to: Resolved - you can auto-populate comments as using onchange client script.
function onChange(control, oldValue, newValue) { |
if (oldValue == newValue)
return;
if(newValue == '6') | |||||
{ | |||||
var caller = g_form.getValue('caller_id'); | |||||
var str = "Hello"+caller+" We have resolved the incident."; | |||||
str = String(str); | |||||
g_form.setValue('comments', str); | |||||
} |
}
Let me know if this helped

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-23-2017 02:45 AM
Hi Stefan, you may check the below post for similar query.
Incident Templates - using variables to customize comments - ServiceNow Express Support