How to update existing incident record using GlideRecord?

nirajjoshi
Tera Contributor
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