history line is getting updated with delay
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-26-2017 11:10 AM
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
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-27-2017 04:57 AM
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.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-27-2017 05:11 AM
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