<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Updating date field in previously resolved tickets in Community Central forum</title>
    <link>https://www.servicenow.com/community/community-central-forum/updating-date-field-in-previously-resolved-tickets/m-p/3490356#M6076</link>
    <description>&lt;P&gt;Hello all,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am attempting to update a date field when a ticket was changed to resolved state. I was trying to use a glide walker, but I don't see that plugin in our list of installed (unless I'm not looking in the right place). I have checked to make sure that audit is selected on the form in question. I have updated the form so that when the state is marked as resolved it will update the resolved date field correctly, but now I'm trying to updated previously resolved tickets.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The fix script I tried:&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var gr = new GlideRecord('u_content_requests');

gr.addQuery('state', '5');
gr.addNullQuery('u_resolved_date');
gr.query();

var count = 0;

while (gr.next()) {

	var hw = new sn_hw.GlideHistoryWalker(gr.getTableName(), gr.getUniqueValue());
	
	if (hw.walkToFieldValue('state', 'resolved')) {

		var historySnapshot = hw.getUpdateSnapshot();
		var actualDate = historySnapshot.sys_updated_on;
		
		gr.u_resolved_date = actualDate;

	gr.setWorkflow(false);
	gr.autoSysFields(false);
	gr.setLimit(10);
	gr.update();
	
	gs.info("Success: Updated  " + gr.number + "with date: " + actualDate);
	count++;
	}
	
	else {
		gs.warn('no history found for content request: ' + gr.number);
	}
	gs.info('fix script for content requests completed. total updated: ' + count);
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any insight or assistance would be appreciated!&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 16 Feb 2026 18:40:42 GMT</pubDate>
    <dc:creator>MegC</dc:creator>
    <dc:date>2026-02-16T18:40:42Z</dc:date>
    <item>
      <title>Updating date field in previously resolved tickets</title>
      <link>https://www.servicenow.com/community/community-central-forum/updating-date-field-in-previously-resolved-tickets/m-p/3490356#M6076</link>
      <description>&lt;P&gt;Hello all,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am attempting to update a date field when a ticket was changed to resolved state. I was trying to use a glide walker, but I don't see that plugin in our list of installed (unless I'm not looking in the right place). I have checked to make sure that audit is selected on the form in question. I have updated the form so that when the state is marked as resolved it will update the resolved date field correctly, but now I'm trying to updated previously resolved tickets.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The fix script I tried:&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;var gr = new GlideRecord('u_content_requests');

gr.addQuery('state', '5');
gr.addNullQuery('u_resolved_date');
gr.query();

var count = 0;

while (gr.next()) {

	var hw = new sn_hw.GlideHistoryWalker(gr.getTableName(), gr.getUniqueValue());
	
	if (hw.walkToFieldValue('state', 'resolved')) {

		var historySnapshot = hw.getUpdateSnapshot();
		var actualDate = historySnapshot.sys_updated_on;
		
		gr.u_resolved_date = actualDate;

	gr.setWorkflow(false);
	gr.autoSysFields(false);
	gr.setLimit(10);
	gr.update();
	
	gs.info("Success: Updated  " + gr.number + "with date: " + actualDate);
	count++;
	}
	
	else {
		gs.warn('no history found for content request: ' + gr.number);
	}
	gs.info('fix script for content requests completed. total updated: ' + count);
}&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any insight or assistance would be appreciated!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Feb 2026 18:40:42 GMT</pubDate>
      <guid>https://www.servicenow.com/community/community-central-forum/updating-date-field-in-previously-resolved-tickets/m-p/3490356#M6076</guid>
      <dc:creator>MegC</dc:creator>
      <dc:date>2026-02-16T18:40:42Z</dc:date>
    </item>
    <item>
      <title>Re: Updating date field in previously resolved tickets</title>
      <link>https://www.servicenow.com/community/community-central-forum/updating-date-field-in-previously-resolved-tickets/m-p/3490628#M6077</link>
      <description>&lt;P&gt;hey&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/836611"&gt;@MegC&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;try this :&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;var gr = new GlideRecord('u_content_requests');
gr.addQuery('state', '5'); // resolved state value
gr.addNullQuery('u_resolved_date');
gr.query();

var count = 0;

while (gr.next()) {

var audit = new GlideRecord('sys_audit');
audit.addQuery('documentkey', gr.sys_id);
audit.addQuery('fieldname', 'state');
audit.addQuery('newvalue', '5'); // resolved value
audit.orderBy('sys_created_on'); // first time it became resolved
audit.setLimit(1);
audit.query();

if (audit.next()) {
    gr.u_resolved_date = audit.sys_created_on;
    gr.setWorkflow(false);
    gr.autoSysFields(false);
    gr.update();
    gs.info('Updated ' + gr.number + ' with resolved date: ' + audit.sys_created_on);
    count++;
} else {
    gs.warn('No state change audit found for: ' + gr.number);
}
}
gs.info('Fix script completed. Total updated: ' + count);&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;&lt;STRONG&gt;*************************************************************************************************************&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;If this response helps, please mark it as Accept as Solution and Helpful.&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;Doing so helps others in the community and encourages me to keep contributing.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Regards&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;Vaishali Singh&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Feb 2026 07:08:36 GMT</pubDate>
      <guid>https://www.servicenow.com/community/community-central-forum/updating-date-field-in-previously-resolved-tickets/m-p/3490628#M6077</guid>
      <dc:creator>vaishali231</dc:creator>
      <dc:date>2026-02-17T07:08:36Z</dc:date>
    </item>
    <item>
      <title>Re: Updating date field in previously resolved tickets</title>
      <link>https://www.servicenow.com/community/community-central-forum/updating-date-field-in-previously-resolved-tickets/m-p/3490707#M6079</link>
      <description>&lt;P&gt;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/836611"&gt;@MegC&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;if table is audited then you can do this&lt;/P&gt;
&lt;P&gt;You can do GlideRecord from following tables,&lt;/P&gt;
&lt;P&gt;&lt;STRONG&gt;sys_history_set&lt;/STRONG&gt; and &lt;STRONG&gt;sys_history_line&lt;/STRONG&gt;&lt;/P&gt;
&lt;P&gt;For e.g. I am fetching history for incident number 'INC0010016' and getting when State changed to some value from empty&lt;/P&gt;
&lt;LI-CODE lang="javascript"&gt;var incident = new GlideRecord('incident');
incident.addQuery('number','INC0010016');
incident.query();

while(incident.next()){

var history = new GlideRecord('sys_history_set');
history.addQuery('id',incident.getValue('sys_id'));
history.query();
history.next();

var auditH = new GlideRecord('sys_history_line');
auditH.addQuery('set',history.getValue('sys_id'));
auditH.addEncodedQuery("label=State^newISNOTEMPTY^oldISEMPTY"); // new is not epmty and old is empty
auditH.query();
if(auditH.next()){

incident.u_field = new GlideDateTime(auditH.sys_created_on).getDate();
incident.update();

}

}&lt;/LI-CODE&gt;
&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":light_bulb:"&gt;💡&lt;/span&gt; If my response helped, please mark it as correct &lt;span class="lia-unicode-emoji" title=":white_heavy_check_mark:"&gt;✅&lt;/span&gt; and close the thread &lt;span class="lia-unicode-emoji" title=":locked:"&gt;🔒&lt;/span&gt;— this helps future readers find the solution faster! &lt;span class="lia-unicode-emoji" title=":folded_hands:"&gt;🙏&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 17 Feb 2026 08:01:42 GMT</pubDate>
      <guid>https://www.servicenow.com/community/community-central-forum/updating-date-field-in-previously-resolved-tickets/m-p/3490707#M6079</guid>
      <dc:creator>Ankur Bawiskar</dc:creator>
      <dc:date>2026-02-17T08:01:42Z</dc:date>
    </item>
    <item>
      <title>Re: Updating date field in previously resolved tickets</title>
      <link>https://www.servicenow.com/community/community-central-forum/updating-date-field-in-previously-resolved-tickets/m-p/3491438#M6083</link>
      <description>&lt;P&gt;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/836611"&gt;@MegC&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Hope you are doing good.&lt;/P&gt;
&lt;P&gt;Did my reply answer your question?&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":light_bulb:"&gt;💡&lt;/span&gt; If my response helped, please mark it as correct &lt;span class="lia-unicode-emoji" title=":white_heavy_check_mark:"&gt;✅&lt;/span&gt; and close the thread &lt;span class="lia-unicode-emoji" title=":locked:"&gt;🔒&lt;/span&gt;— this helps future readers find the solution faster! &lt;span class="lia-unicode-emoji" title=":folded_hands:"&gt;🙏&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Feb 2026 03:28:45 GMT</pubDate>
      <guid>https://www.servicenow.com/community/community-central-forum/updating-date-field-in-previously-resolved-tickets/m-p/3491438#M6083</guid>
      <dc:creator>Ankur Bawiskar</dc:creator>
      <dc:date>2026-02-18T03:28:45Z</dc:date>
    </item>
    <item>
      <title>Re: Updating date field in previously resolved tickets</title>
      <link>https://www.servicenow.com/community/community-central-forum/updating-date-field-in-previously-resolved-tickets/m-p/3491457#M6084</link>
      <description>&lt;P&gt;&lt;A class="" href="https://www.servicenow.com/community/user/viewprofilepage/user-id/836611" target="_self"&gt;&lt;SPAN class=""&gt;Hi MegC,&lt;/SPAN&gt;&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;If Your table/application is having any backend flow/workflow, it is best using that you can store the previous value of your Date field in scratchpad and use that till end of the flow.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN class=""&gt;You can do it using by hitting audit table if your custom table is audited. BUT it is not at all recommended. it can &lt;U&gt;&lt;STRONG&gt;cause performance issue of your instance in long run&lt;/STRONG&gt;&lt;/U&gt;.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Feb 2026 04:27:34 GMT</pubDate>
      <guid>https://www.servicenow.com/community/community-central-forum/updating-date-field-in-previously-resolved-tickets/m-p/3491457#M6084</guid>
      <dc:creator>Tanushree Maiti</dc:creator>
      <dc:date>2026-02-18T04:27:34Z</dc:date>
    </item>
    <item>
      <title>Re: Updating date field in previously resolved tickets</title>
      <link>https://www.servicenow.com/community/community-central-forum/updating-date-field-in-previously-resolved-tickets/m-p/3491745#M6086</link>
      <description>&lt;P&gt;hey&amp;nbsp;&lt;a href="https://www.servicenow.com/community/user/viewprofilepage/user-id/836611"&gt;@MegC&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Hope you are doing well.&lt;/P&gt;&lt;P&gt;Did my previous reply answer your question?&lt;/P&gt;&lt;P&gt;If it was helpful, please mark it as correct ✓ and close the thread &lt;span class="lia-unicode-emoji" title=":locked:"&gt;🔒&lt;/span&gt;. This will help other readers find the solution more easily.&lt;/P&gt;&lt;P&gt;Regards,&lt;BR /&gt;Vaishali Singh&lt;/P&gt;</description>
      <pubDate>Wed, 18 Feb 2026 10:46:29 GMT</pubDate>
      <guid>https://www.servicenow.com/community/community-central-forum/updating-date-field-in-previously-resolved-tickets/m-p/3491745#M6086</guid>
      <dc:creator>vaishali231</dc:creator>
      <dc:date>2026-02-18T10:46:29Z</dc:date>
    </item>
  </channel>
</rss>

