Built something you're proud of? Tell the story. A quick G2 review of App Engine or Build Agent helps other developers see what's possible on ServiceNow. Share your experience.

Modifying and Copying Activity Stream entries.

marclindsay
Tera Guru

1st scenario - A business requirement where we need to transfer existing historical content, that shows in the Activity stream from one case record to another case record. 

 

2nd scenario - Business requirement to update Activity Stream entries with a different created user and create time, to reflect the original creation of the case record. 

 

I understand modifying system fields such as sys_created_by or replicating full audit histories (e.g., field-level changes stored in sys_audit) is not supported and is generally discouraged, especially in production environments. We have a bug scenario where this is needed for a select few records. This is a one fix that is needed. 


1 REPLY 1

Weird
Mega Sage

I don't see why you couldn't copy data from sys_audit to another record like you would any other record.
Just query sys_audit with GlideRecord and insert each row for another record by replacing the key/sys_id for the other one.

You don't even need to copy the history set and lines. You can just delete the existing one and it will generate a new one based on the audit data, so for your second scenario you can just edit the sys_audit record, delete the history set and lines and when you view the record again it should generate new data for you.

Do note that on domain separated instances there's a separate history set for each domain that viewed the record.