- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2019 02:29 AM
Hi All,
I have one requirement to update one Incident Record Opened Date Field from
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2019 04:11 AM
you can run the below code in background script by adding your specific incident number and date value.
var gr=new GlideRecord('incident');
gr.addQuery('number', 'INC#####');
gr.query();
if(gr.next())
{
gr.opened_at='2018-12-27 20:37:44';
gr.update();
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2019 03:57 AM
Hi
Use gr.addQuery("sys_id","your incident sys_id") and it will work for 1 record.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2019 04:58 AM
Hi,
Any updates?
you can use this code in background script as well as in fix script.
advantage with doing fix script is , we can capture script into update set and move to test and production instance.
thanks,
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2019 09:22 AM
Hi Varsha,
Thanks for your quick help. It really worked for me. Thanks a lot....

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-03-2019 04:11 AM