- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-06-2013 08:06 PM
Hi,
I have used this in the background script for some testing, however the same logic can be used in the business rule to fetch the desired result and insert in a custom table and use the custom table for reporting or can be used as a schedule job. This is specific to show records for Incident table only.
Hope this is what you were looking for
=======================================================================
var gr = new GlideRecord('sys_history_line');
var q1 = gr.addQuery('set.table','=','incident');
var q2 = gr.addQuery('field','=','priority');
gr.query();
//gs.print (gr.getRowCount());
//gs.print ('OLD Value'+" "+'New Value'+" "+ 'Updated By');
while (gr.next())
{
gs.log(gr.set.getDisplayValue());
gs.log(gr.old);
gs.log(gr.new_value.getDisplayValue());
gs.log(gr.user_name.getDisplayValue());
gs.log(gr.update_time);
gs.print("------------------------------------------");
}