Need to Update Old Records using Fix Script

Priyanka1997
Tera Contributor

Hi Everyone,

 

In Incident table, I have to change old records and condition will be like, If 'Test Completion Date' is not empty, then the 'Status' should set to "Completed".

 

Kindly help me If anyone used any Fix Script for such issue.

1 ACCEPTED SOLUTION

RaghavSh
Kilo Patron

 

var inc = new GlideRecord('incident');
inc.addQuery('Test Completion Date' ,  '!=' , '');   // check the backend name of test completion date and modify accordingly
inc.query();
while(inc.next())
{
inc.status=3;            // check the value of completed state and mofidy accordingly.
inc.update();
}

 


Raghav
MVP 2023

View solution in original post

2 REPLIES 2

RaghavSh
Kilo Patron

 

var inc = new GlideRecord('incident');
inc.addQuery('Test Completion Date' ,  '!=' , '');   // check the backend name of test completion date and modify accordingly
inc.query();
while(inc.next())
{
inc.status=3;            // check the value of completed state and mofidy accordingly.
inc.update();
}

 


Raghav
MVP 2023

Thanks @RaghavSh for your prompt reply, Its perfectly working for me.