history line is getting updated with delay

Venkat122
Kilo Guru

Hi All,

when we want to query history line table to know what field value has been changed, the table is not getting updated as soon as record is updated. why delay is happening, if yes then how we can check on expected time accurately to update history table.

Regards,

Swamy

6 REPLIES 6

You don't need any sort of audit history to determine what fields changed in the update.



In a before business rule, you could trigger the web service call.


There is a function that will return an array of all of the fields that changed. (Note, I think this only works in a before rule)



var gru =   new GlideScriptRecordUtil.get(current)


var fieldsChanged = gru.getChangedFieldNames();



Note, you can see this in use in the metrics events business rule.



Another option, as you can see from this business rule, is there is an event triggered with that list of field names


You could write a script action that triggers from that same event that is already there, and you have the list of fields that have changed in the parameters of that event.


Actually we are using a third party tool to access servicenow tables and trigger web service with the changed fields.



Is there any way to record as watched in order to update history line table updated through a script