Script needed to update resolved_at in incident

Saib1
Tera Guru

Can you tell me script or any method to upsdate resolved_at in incident 

 

currently incident in closed state

3 REPLIES 3

Jaspal Singh
Mega Patron
Mega Patron

Hi Sai,

Did you try using background script? Additionally,  if you use Windows you can press Ctrl + Shift + Alt + J and then set the value client side using g_form.setValue('resolved_at','datetime you want to pass'); & then save the record

Sandeep Rajput
Tera Patron
Tera Patron

@Saib1 Here is the script which you can run in your background script.

 

var glideRecord = new GlideRecord('incident');
if(glideRecord.get('f12ca184735123002728660c4cf6a7ef')){//Replace with you incident sys_id
    glideRecord.setValue('resolved_at','2023-07-04 14:39:39');
    glideRecord.update();
}

 

Mark Roethof
Tera Patron
Tera Patron

Hi there,

 

Before sharing any script, it would be better to understand your situation.

 

Is this just a one-time fix? On a single record? On multiple records? Or do you want to perform this more often, or perhaps even scheduled? Or should by default already the resolved_at get a different behavior than you are experiencing now?

 

Please clarify your situation so we can help you better.

 

Kind regards,

 

Mark Roethof

Independent ServiceNow Consultant

10x ServiceNow MVP

---

 

~444 Articles, Blogs, Videos, Podcasts, Share projects - Experiences from the field

LinkedIn