- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2025 07:29 AM - edited 02-13-2025 07:33 AM
I'm attempting to create a fix script that will populate two new fields on the incident form for all existing incidents. The two fields (asset tag and serial number) are both dependent on the value of the Configuration item field. With the newly created onChange Client script these two new fields will auto populate with their respective values from the asset chosen in the Configuration item. Below is what I have so far that is not working. Can anyone provide some insight? Thanks.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2025 07:32 AM
Your GlideRecord is instantiated as grIncident, but you are using gr. in the while loop. Change all of these appearances to grIncident, and you should be closer.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2025 07:32 AM
Your GlideRecord is instantiated as grIncident, but you are using gr. in the while loop. Change all of these appearances to grIncident, and you should be closer.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2025 07:39 AM
I see. Now the script is doing the opposite. It's emptying the value of the new fields for all incidents.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2025 07:44 AM
Hey James,
It's might be the reason that your ci fileds like asset_tag and serial_number might be differnt or the ci's doesn't have these values in the configuration_item table.
Just double check.
Regards,
Debasis
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-13-2025 07:44 AM - edited 02-13-2025 07:50 AM
Do the incidents with the cleared fields have a cmdb_ci populated, and does that CI record have a asset_tag and/or serial_number populated? Are your custom fields the same Types as the two fields on the CI table/record?