incident record from a sys_id?
This content was last updated in 2023. It may still be useful, but could contain outdated information. Please confirm its accuracy before relying on it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-30-2023 11:33 PM
How to get incident record from a sys_id in script??
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-31-2023 12:33 AM
Yes, make sense.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-31-2023 01:18 AM
var incidentSysId = 'your_incident_sys_id';
var gr = new GlideRecord('incident');
if (gr.get(incidentSysId)) {
var incidentNumber = gr.getValue('number');
var shortDescription = gr.getValue('short_description');
gs.info('Incident Number: ' + incidentNumber);
gs.info('Short Description: ' + shortDescription);
} else {
gs.info('Incident not found.');
}