When Incident work_notes is updated to empty string via script, Notes section disappears
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-26-2025 06:35 AM
Hi Team,
When Incident work_notes is updated to empty string via script, Notes section disappears and shows No Activity.
inc.work_notes = " ";
if you look at below image, there are activities..
But when same incident is updated via script like below:
var inc = new GlideRecord('incident');
inc.addQuery('active',true);
inc.addQuery('number','INC02776931');
inc.setLimit(1 ) ;
inc.query();
if(inc.next()){
inc.work_notes = " ";
inc.state = "2";
inc.update();
inc.setWorkflow(false);
}
now it shows No Activity even though there are activates if I export the XML and i can found it there.
If i go to sys_journal_field table then i can see blank entry there but even i delete it or update it, still on Incident UI Notes section not loading.
How to fix it as we have multiple Incident records of same?
Regards,
Bharat
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-26-2025 06:44 AM
@Bharat Shinde Why are you updating empty string in work_notes ? what is the requirement here?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-27-2025 11:04 PM
Hi @SANDEEP28
I am not updating empty string, actually we have integration with third-party and they are sending in their payload while updating back the incident for other fields. We have inform them but i am not sure why ServiceNow behaving like this as we do not have control.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-26-2025 07:30 AM
Hi All,
it seems i found the solution for this:
I tried for one record on which Activity section was not showing, and following below steps I am able to see that section and activities back again.
Note* But this is manual and tedious process if there are too many incident record to fix by this way, this needs to perform first on non-prod environment and thoroughly verified.
Step 1: journal entry->
sys_journal_field.FILTER (ElementID=sys_id of incident record)
Need to delete the blank entry of work_notes from this table
Step 2: audit entry->
sys_audit.FILTER (DocumentKey=sys_id of incident record) - Remove OldValue and update NewValue
Need to delete the blank entry of work_notes from this table
Step 3: history entry->
sys_history_set.FILTER (ID=sys_id of incident record) - delete record from here
Need to delete the history record of that incident from this table
Reference Video:
How to update existing work notes/comments from a record in servicenow
https://www.youtube.com/watch?v=bcK8Ajdl5c4
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-27-2025 11:36 PM
Actually I don't suggest to use table API directly for integration. You should try to use scripted rest API to restrict the dirty data like blank work_notes into ServiceNow.