Update a field value in "sys_history_line" table (Form Level)

Hansika1
Tera Contributor

Hi,

 

I am trying to develop a solution to Modify the username in Activity of Case form. I am able to achieve this by list editing the 'user_name' field of 'sys_history_line' table. However, the requirement demands a business rule creation for achieving the same. But, the sys_history_line doesn't allow me to do form level update. The form loads and the field value is reset back to older value. Please help!

3 REPLIES 3

Hayo Lubbers
Kilo Sage

Hi @Hansika1 ,

 

Why would you want to change the audit trail?

 

The sys_history_line is generated, based on the sys_audit. For more information, have a look at https://docs.servicenow.com/bundle/washingtondc-platform-security/page/administer/security/concept/c...

 

Hansika1
Tera Contributor

Hi Hayo,

 

I totally get the concept of hierarchy between Audit table & History sets. However, our business requirement is to hide the USERNAME appearing in the activity stream of a ticket form  when the user posts a comment. I believe, sys_history_line is the only table that can be modified to achieve this functionality without actually disturbing the audit records.

 

Kindly clarify me!

Hi @Hansika1 ,

 

Business Rules don't seem to work on the sys_history_line and you have some out of the box ACL's limiting writing to 'nobody', so changing that would be difficult. And from a performance point of view, probably also undesirable.

 

Looking at the requirement, you seem to want the username of a journal entry obfuscated. That's not the sys_history_line, but the sys_journal_field. Changing that, would change the audit trail.

If it is only the portal, you can clone and modify the portal widget showing the activity stream. If the requirement is also for the backend, I would strongly recommend to go back to the business that this is, for audit reasons, not possible.