- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-28-2025 04:43 AM
hi there
i am looking for a possibility to read the activity stream state changes.
I tried with sys_journal field, but i only shows work notes.
is there a table where the state changes form the activity stream are shown?
kind regards
Oliver
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-28-2025 04:51 AM - edited 03-28-2025 04:53 AM
@xlarge74 Yes, sys_journal_field table primarily tracks Work Notes and Comments, To specifically track state changes, you should use the sys_audit table, which logs all field changes, including state transitions.
To query and track state changes in a table (e.g., Incident), you can use the following approach:
var auditGR = new GlideRecord('sys_audit');
auditGR.addQuery('tablename', 'incident'); // Specify the table, e.g., Incident, Change Request
auditGR.addQuery('fieldname', 'state'); // Focus on changes to the 'state' field
auditGR.query();
while (auditGR.next()) {
gs.info('State Change: ' + auditGR.new_value + ' from ' + auditGR.old_value);
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-28-2025 07:15 AM
I would try to avoid solutions that queries the sys_audit table whenever possible.
Instead you can implement a custom field that counts the number of times an Asset is set to in use (set it by business rule) and take actions when the counter exceeds a certain value.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-28-2025 04:51 AM - edited 03-28-2025 04:53 AM
@xlarge74 Yes, sys_journal_field table primarily tracks Work Notes and Comments, To specifically track state changes, you should use the sys_audit table, which logs all field changes, including state transitions.
To query and track state changes in a table (e.g., Incident), you can use the following approach:
var auditGR = new GlideRecord('sys_audit');
auditGR.addQuery('tablename', 'incident'); // Specify the table, e.g., Incident, Change Request
auditGR.addQuery('fieldname', 'state'); // Focus on changes to the 'state' field
auditGR.query();
while (auditGR.next()) {
gs.info('State Change: ' + auditGR.new_value + ' from ' + auditGR.old_value);
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-28-2025 04:52 AM
Hi @xlarge74 ,
Please make sure that from the Filter activity Incident State is selected. If not then select it and then see if state changes are showing in Activities or not. Refer Snip Below.
If my response helped, please hit the Thumb Icon and accept the solution so that it benefits future readers.
Regards,
Rohit

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-28-2025 04:57 AM
Hi,
All changes made (that are audited) are captured in the sys_audit table.
This table is usually huge, due to the large number of changes made in any ServiceNow instance.
What are you trying to do ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-28-2025 06:27 AM
hello thanks for the answers...
i will try your hints on monday
PS: i´m on alm_hardware and i try to find out if an asset is set to "in use" the second time. afterwards i have to do some changes
kind regards
oliver