How to get history details after updating data using autoSysFields?

Ravish Shetty
Tera Guru

For a change task data, 'assigned_to' field got updated from A to B due to a business rule because we ran an update script in which we used autoSysFields(false).

Now we want to know what the previous assigned to was but when i check the history it shows value B even when the record was created.

4 REPLIES 4

The SN Nerd
Giga Sage
Giga Sage

autoSysFields(Boolean e)


Enables or disables the update to the fields sys_updated_by, sys_updated_on, sys_mod_count, sys_created_by, and sys_created_on. This is often used for manually updating field values on a record while leaving historical information unchanged.
GlideRecord - ServiceNow Wiki

The whole purpose of autoSysFields(false) is to make an update to a ticket without capturing any audit details.


If you want a record that the ticket has changed, you simply cannot use autoSysFields(false).



ServiceNow Nerd
ServiceNow Developer MVP 2020-2022
ServiceNow Community MVP 2019-2022

Hello Paul, Here an undesirable behavior has happened. I am talking about the 'Assigned to' field which got updated...though that was not because of using autoSysFields(false) but due to a business rule. It's not like i want the time or updated by information of when the update script was ran...i want to retrieve the old Assigned to but i am unable to.


If any business rule with autoSysFields(false) was triggered on the same transaction in which the assigned to field was updated, there is no way to find out what the old value was.



Are you saying that the 'assigned_to' field being changed was not intentional written in a business rule and your not sure why it occured?



ServiceNow Nerd
ServiceNow Developer MVP 2020-2022
ServiceNow Community MVP 2019-2022

Okay, i got the answer. We are yet to investigate which business rule was responsible...not sure if it was a valid change or invalid Next time i will try using setWorkflow false.



We checked with the SN support and they have asked us to go through the sys_audit table to get the details.