For the most part your interaction with comments in ServiceNow has been through the activity log on the form view of a record. However, the handling for comments has a lot of moving parts to it. This article will cover those pieces and how they play a role in what you see.
ServiceNow supports comments by storing the comments in the Journal Fields [sys_journal_field] table. When you make a comment, that comment is then loaded into the Journal Fields table. This table will note down the content, table, base record, and type (work_note/comment) of the comment.
A small, but important, detail of this is that when you are making a comment on a record, that comment is “embedded” in the record.
If you are familiar with Business Rules in ServiceNow this will partially dictate how the comments are replicated.
When you pull up the record the Activity Log is drawn from this record's Journal Fields and Audit Log (more details below).
How you decide to replicate comments will vary slightly depending on what you want to accomplish.
If you are replicating from ServiceNow to Database than you will want to use our “Include Journal Fields” checkbox on the form of the Bulk Share or Dynamic Share. If you are using a Dynamic Share you will want to set your “Business Rule When” to “After”, since the Journal Fields will be created “After” the update has occurred.
This will send you the comments as individual records that you can then look up and link to the record in your Journal Fields [sys_journal_field] table in your Database.
If you are replicating comments between ServiceNow instances and/or through one of our SIAM integrations than you will want to send the comments through the embedded record. This means that you will NOT be using “Include Journal Field”. Instead you will set your “Business Rule When” to “Before”. The comment will be embedded in the record update and sent across. The Subscribing instance will then utilize that and generate the comment itself.
If you have both “Business Rule When” set to “Before” and “Include Journal Fields” checked than you may end up creating duplicate comments on the Subscribing instance. As you are both:
When you are looking at the Activity Log of a record in ServiceNow you are looking at the History Set [sys_history_set] of that record. ServiceNow has some good documentation on these, for starters:
As a summary ServiceNow has the History Set of records which have been modified or accessed recently. These will be generated dynamically and cleaned up after a period time of no one accessing or modifying the base record. This is so the Activity Log can draw from this table quickly as opposed to querying the audit and journal field table every time a user loads the form.
Additionally a History Set will be generated for each domain (as necessary) when accessing a record. So you may see a different History Set in the /TOP domain versus the /TOP/Standard/ACME domain. In general though, they should be the same.
Earlier you read that the Activity Log was generated from from the Journal Fields. This is a bit of a simplification. In reality the full process is:
So the History Set is generated dynamically by the Audit and Journal Field records.