How to update existing incident record using GlideRecord?
This content was last updated in 2024. It may still be useful, but could contain outdated information. Please confirm its accuracy before relying on it.
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2024 01:39 AM
Run the below script in background script i.e All=> script background
var incGr=new GlideRecord("incident"); // Creates incGr as new incident table object
incGr.addQuery('number','INC0010542'); // To update existing incident given incident number
incGr.query(); // executes the query based on the incident record fetched
if(incGr.next())
{
incGr.short_description="Test From Developer Course"; //adding the short description
incGr.urgency=1; //updating urgency to 1 i.e HIGH
incGr.impact=1; //updating impact to 1 i.e HIGH
incGr.update(); //Updates the incident with above values in incident table
}
0 REPLIES 0