
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-29-2019 02:51 PM
I am looking for a way to fill in fields even if they are already filled in without using dot walking. I'm not sure if there's another alternative or not. Looking for any ideas that anyone might have
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-30-2019 02:44 PM
Hi Mitch,
You can set these fields using an onChange client script with the "Configuration item" (cmdb_ci) as the field name.
The following code is just an example of how you can retrieve data from the CI and populate the incident table using getReference:
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
var ci = g_form.getReference("cmdb_ci", callBack);
}
function callBack(ci){
if (ci) {
var cusSysId = ci.assigned_to; //assigned to user on the ci record
var locSysId = ci.location; //ci location
g_form.setValue("caller_id", cusSysId); //set caller with the user assigned to the ci
g_form.setValue("location", locSysId); //set location based on ci location
}
}
I personally prefer GlideAjax which has a client and server requirement to work. The benefit of using GlideAjax is that it only returns the data that you need rather than the whole record.
Let me know if this answered your question.
Brent
P.S. If my suggestion helped then please mark as helpful and/or correct so other community members can benefit from this information.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-29-2019 02:52 PM
I am attempting to auto populate the customer, location, etc. based upon configuration item selection.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-30-2019 11:05 AM
..updating because this just got approved for posting
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-30-2019 02:44 PM
Hi Mitch,
You can set these fields using an onChange client script with the "Configuration item" (cmdb_ci) as the field name.
The following code is just an example of how you can retrieve data from the CI and populate the incident table using getReference:
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
var ci = g_form.getReference("cmdb_ci", callBack);
}
function callBack(ci){
if (ci) {
var cusSysId = ci.assigned_to; //assigned to user on the ci record
var locSysId = ci.location; //ci location
g_form.setValue("caller_id", cusSysId); //set caller with the user assigned to the ci
g_form.setValue("location", locSysId); //set location based on ci location
}
}
I personally prefer GlideAjax which has a client and server requirement to work. The benefit of using GlideAjax is that it only returns the data that you need rather than the whole record.
Let me know if this answered your question.
Brent
P.S. If my suggestion helped then please mark as helpful and/or correct so other community members can benefit from this information.