serial number populating on the incident form
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2024 06:42 AM - edited 06-05-2024 06:42 AM
i tried to do a before br on the incident form . i have a field called u_impacted_asset so when i entered the caller infomation it should automatically populate the impacted asset box . it is not working now
// Get the caller's username from the incident ticket
var caller = current.caller_id;
// Query the alm_asset table to find the asset assigned to the caller
var assetGr = new GlideRecord('alm_asset');
assetGr.addQuery('assigned_to', caller);
assetGr.query();
if (assetGr.next()) {
// Populate the u_impacted_asset field with the found asset's serial number
current.u_impacted_asset = assetGr.serial_number;
}
- Labels:
-
Incident Management

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2024 06:47 AM
Hi,
Curious to why you're populating an asset record within Incident Management. Assets (generally) have a configuration item attached which should be populated in the configuration item field on an incident form
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2024 06:51 AM
the business needs to have the CI for some thing else and a field for serial number @Kieran Anson

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2024 06:54 AM
That doesn't sound like a genuine need for a customisation, additional configuration items can be added to a incident via the Affected CIs related list
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-05-2024 08:30 AM
@Kieran Anson sorry i do not want to be rude . i do not understand why are judging on what you feel is a genuine needs or not. it is an opportunity of learning since Servicenow is a great platform for scripting. it is my company needs and not yours. thanks