
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-05-2025 05:05 PM
Hello everyone
'm currently experiencing an issue with journal activities in the system.
Many incidents are missing their Activity History. When I click the filter icon, no filters are displayed at all. I’ve tested this by adding work notes, and I can confirm the entries are present in the sys_journal_field table. This issue appears to affect tickets assigned to specific groups. However, changing the assignment group does not resolve the problem.
For incidents where the issue does not occur, the activity filter appears as expected (see example below). Has anyone encountered this before or have any ideas on what might be causing it?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-05-2025 05:39 PM
Hi @Mari2 ,
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB2185849
you do the following to resolve this
go to sys_journal_field table and filter with your record's sysid and find if there are any records with value looks empty and delete those
go to sys_audit table and do the same find records with fields work_notes or comments new value is empty and delete those
finally go the sys_history_set table and delete all the records related to that task record(this is for immediate effect)
issue
Remove blank journal entries and all associated history sets. Removes sys audits, journal entries, and history sets. Removal is performed in chunks of 800 at a time, configurable by modifying the LIMIT constant.
A journal entry is considered to be blank if:
- It is empty
- It contains only whitespace characters
- It contains a single empty [code][/code] tag
- It contains a single [code][/code] tag containing only whitespace characters
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB2139855
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB2185849
or you can run below script as fix script or bg script to solve this thought out the instance
var LIMIT = 800;
var EMPTY_EXP = '^(\\[code]\\s*\\[/code])?$';
var SYS_AUDIT = 'sys_audit';
var SYS_JOURNAL_FIELD = 'sys_journal_field';
var TABLE_CONFIG = {};
TABLE_CONFIG[SYS_AUDIT] = {
tableColumn: 'tablename',
valueColumn: 'newvalue'
};
TABLE_CONFIG[SYS_JOURNAL_FIELD] = {
tableColumn: 'name',
valueColumn: 'value'
};
removeEmptyJournalEntries();
function removeEmptyJournalEntries(auditsComplete, journalsComplete) {
var auditCount = auditsComplete ? 0 : removeChunk(SYS_AUDIT);
var journalCount = journalsComplete ? 0 : removeChunk(SYS_JOURNAL_FIELD);
if (auditCount === LIMIT || journalCount === LIMIT) {
removeEmptyJournalEntries(auditCount < LIMIT, journalCount < LIMIT);
}
}
function removeChunk(table) {
return clean(
collectChunkOfEmptyRecordIds(
new Result(table),
recordCreator(table)
)
);
}
function collectChunkOfEmptyRecordIds(result, createRecord) {
collectEmptyRecordIds(result, createRecord("EMPTY"));
if (result.size() < LIMIT) {
collectEmptyRecordIds(result, createRecord("SPACE"));
}
if (result.size() < LIMIT) {
collectEmptyRecordIds(result, createRecord("CODE"));
}
return result;
}
function collectEmptyRecordIds(result, record) {
while (result.size() < LIMIT && record.nextValueIsEmpty()) {
result.addSysId(record.getValue('sys_id'));
result.addElementId(record.getValue('element_id'));
}
}
function clean(result) {
var size = result.size();
if (size > 0) {
var table = result.table;
var tableCleaner = new GlideTableCleaner(table, 0);
tableCleaner.setConditions('sys_idIN' + result.sys_id.join(','));
tableCleaner.clean();
if (table === SYS_JOURNAL_FIELD) {
var historyCleaner = new GlideTableCleaner('sys_history_set', 0);
historyCleaner.setConditions('idIN' + Object.keys(result.element_id).join(','));
historyCleaner.clean();
}
}
return size;
}
function recordCreator(table) {
return function (type) {
var config = TABLE_CONFIG[table];
var record = new GlideRecord(table);
if (table === SYS_AUDIT) record.addQuery('oldvalue', 'JOURNAL FIELD ADDITION');
if (type === "CODE") record.addQuery(config.valueColumn, 'STARTSWITH', '[code]');
if (type === "EMPTY") record.addEncodedQuery(config.valueColumn + "ISEMPTY^OR" + config.valueColumn + "=[code][/code]");
record.orderBy(config.valueColumn);
record.setLimit(LIMIT);
record.query();
return new Record(config, record);
};
}
function Result(table) {
this.element_id = {};
this.sys_id = [];
this.table = table;
this.addSysId = function (id) { this.sys_id.push(id); };
this.addElementId = function (id) { if (id) this.element_id[id] = true; };
this.size = function () { return this.sys_id.length; };
}
function Record(config, record) {
this.config = config;
this.record = record;
this.getValue = function (column) { return this.record.getValue(column); };
this.nextValueIsEmpty = function () {
return record.next() && (
!this.record.getValue(this.config.valueColumn) ||
this.record.getValue(this.config.valueColumn).trim().match(EMPTY_EXP)
);
};
}
Please mark my answer as helpful/correct if it resolves your query.
Regards,
Chaitanya
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-05-2025 05:39 PM
Hi @Mari2 ,
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB2185849
you do the following to resolve this
go to sys_journal_field table and filter with your record's sysid and find if there are any records with value looks empty and delete those
go to sys_audit table and do the same find records with fields work_notes or comments new value is empty and delete those
finally go the sys_history_set table and delete all the records related to that task record(this is for immediate effect)
issue
Remove blank journal entries and all associated history sets. Removes sys audits, journal entries, and history sets. Removal is performed in chunks of 800 at a time, configurable by modifying the LIMIT constant.
A journal entry is considered to be blank if:
- It is empty
- It contains only whitespace characters
- It contains a single empty [code][/code] tag
- It contains a single [code][/code] tag containing only whitespace characters
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB2139855
https://support.servicenow.com/kb?id=kb_article_view&sysparm_article=KB2185849
or you can run below script as fix script or bg script to solve this thought out the instance
var LIMIT = 800;
var EMPTY_EXP = '^(\\[code]\\s*\\[/code])?$';
var SYS_AUDIT = 'sys_audit';
var SYS_JOURNAL_FIELD = 'sys_journal_field';
var TABLE_CONFIG = {};
TABLE_CONFIG[SYS_AUDIT] = {
tableColumn: 'tablename',
valueColumn: 'newvalue'
};
TABLE_CONFIG[SYS_JOURNAL_FIELD] = {
tableColumn: 'name',
valueColumn: 'value'
};
removeEmptyJournalEntries();
function removeEmptyJournalEntries(auditsComplete, journalsComplete) {
var auditCount = auditsComplete ? 0 : removeChunk(SYS_AUDIT);
var journalCount = journalsComplete ? 0 : removeChunk(SYS_JOURNAL_FIELD);
if (auditCount === LIMIT || journalCount === LIMIT) {
removeEmptyJournalEntries(auditCount < LIMIT, journalCount < LIMIT);
}
}
function removeChunk(table) {
return clean(
collectChunkOfEmptyRecordIds(
new Result(table),
recordCreator(table)
)
);
}
function collectChunkOfEmptyRecordIds(result, createRecord) {
collectEmptyRecordIds(result, createRecord("EMPTY"));
if (result.size() < LIMIT) {
collectEmptyRecordIds(result, createRecord("SPACE"));
}
if (result.size() < LIMIT) {
collectEmptyRecordIds(result, createRecord("CODE"));
}
return result;
}
function collectEmptyRecordIds(result, record) {
while (result.size() < LIMIT && record.nextValueIsEmpty()) {
result.addSysId(record.getValue('sys_id'));
result.addElementId(record.getValue('element_id'));
}
}
function clean(result) {
var size = result.size();
if (size > 0) {
var table = result.table;
var tableCleaner = new GlideTableCleaner(table, 0);
tableCleaner.setConditions('sys_idIN' + result.sys_id.join(','));
tableCleaner.clean();
if (table === SYS_JOURNAL_FIELD) {
var historyCleaner = new GlideTableCleaner('sys_history_set', 0);
historyCleaner.setConditions('idIN' + Object.keys(result.element_id).join(','));
historyCleaner.clean();
}
}
return size;
}
function recordCreator(table) {
return function (type) {
var config = TABLE_CONFIG[table];
var record = new GlideRecord(table);
if (table === SYS_AUDIT) record.addQuery('oldvalue', 'JOURNAL FIELD ADDITION');
if (type === "CODE") record.addQuery(config.valueColumn, 'STARTSWITH', '[code]');
if (type === "EMPTY") record.addEncodedQuery(config.valueColumn + "ISEMPTY^OR" + config.valueColumn + "=[code][/code]");
record.orderBy(config.valueColumn);
record.setLimit(LIMIT);
record.query();
return new Record(config, record);
};
}
function Result(table) {
this.element_id = {};
this.sys_id = [];
this.table = table;
this.addSysId = function (id) { this.sys_id.push(id); };
this.addElementId = function (id) { if (id) this.element_id[id] = true; };
this.size = function () { return this.sys_id.length; };
}
function Record(config, record) {
this.config = config;
this.record = record;
this.getValue = function (column) { return this.record.getValue(column); };
this.nextValueIsEmpty = function () {
return record.next() && (
!this.record.getValue(this.config.valueColumn) ||
this.record.getValue(this.config.valueColumn).trim().match(EMPTY_EXP)
);
};
}
Please mark my answer as helpful/correct if it resolves your query.
Regards,
Chaitanya

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
a month ago
Hi @Chaitanya ILCR,
Thank you so much for sharing this information. It worked! I really appreciate for your input.
Here’s an additional notes based on my testing.
In my case, some affected incidents have record(s) in all three tables, while others had only Journal Entry. If the effected incident has a record in all three tables, just follow the instruction provided by Chaitanya and the issue will be resolved.
However, for the incidents which does not have all three entries, I needed one extra step.
For example, the affected incident is:
- 2 Journal Entries
- 0 record in sys audit
- O record in Record History
In this scenario, one record was created in the sys_history_set table after I deleted the two journal entries. And the issue will be resolved once I delete this newly created Record History.
I have more than 26,000 Journal Entries which are missing Value field on Journal Entries. To clean this up, I am planning to do:
- Delete all records in the sys_journal_field table where the Value field was empty.
- Delete all records in the sys_audit table where the New Value field was empty.
- Finally, deleted all newly created records in the sys_history_set table.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-05-2025 06:19 PM
Hi @Mari2 ,
Even though journal entries like work notes and comments exist in the sys_journal_field table, they won’t appear in the Activity Stream if the corresponding history records in sys_history_set and sys_history_line are missing or not regenerated, simply inserting into sys_journal_field doesn’t rebuild the activity cache..
Try this once and let me know. If you find this helpful, please accept this as a solution and hit the helpful button..
Kaushal Kumar Jha - ServiceNow Consultant - Lets connect on Linkedin: https://www.linkedin.com/in/kaushalkrjha/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-05-2025 09:46 PM
should not occur ideally.
It's strange.
Was this working fine earlier?
Did you recently upgrade?
If my response helped please mark it correct and close the thread so that it benefits future readers.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader