Can I add the Work Notes List on a Report?

Ricardo1
Kilo Contributor

I created a report from the incident table, but I expected that the information in the Work Note List will be shown in the report, but this column is shown blank. i verified that Work Note List represent a Log but, can I add it in the report?

1 ACCEPTED SOLUTION

Dennis R
Tera Guru

Not easily. In a nutshell, the issue you're running into is that the work notes are actually stored in a separate table. As a journal entry field, the work_notes column is actually only used to temporarily store the entry to be created in the journal table, and then it is cleared before the record is inserted or updated in the database. This is why it's showing up blank in your reports.

If you absolutely, positively have to have this, I'd suggest creating a large read-only text field and writing some business rules using GlideElement's getJournalEntry() method to keep the journal entries synced with the content of the new field.

Hope this helps,
--Dennis R

View solution in original post

4 REPLIES 4

Dennis R
Tera Guru

Not easily. In a nutshell, the issue you're running into is that the work notes are actually stored in a separate table. As a journal entry field, the work_notes column is actually only used to temporarily store the entry to be created in the journal table, and then it is cleared before the record is inserted or updated in the database. This is why it's showing up blank in your reports.

If you absolutely, positively have to have this, I'd suggest creating a large read-only text field and writing some business rules using GlideElement's getJournalEntry() method to keep the journal entries synced with the content of the new field.

Hope this helps,
--Dennis R

Ricardo1
Kilo Contributor

ok, if I understood correctly i need add a new field in the form to keep the journal entries using some business rules, but then this information going to be in the DB, rigth?

Kalyan Kothali1
Tera Contributor

Hi Dennis, 

As you have mentioned above, that the work notes is stored in a separate table, can you please let me know in which table the work notes are stored.

 

Thanks,

Kalyan. 

They're in the sys_journal_field table. The fields are as follows:

FieldDescription
nameTable name (for example, "change_request")
element_idSys id of record that contains journal entry
elementField in table in which journal entry was entered (for example, "work_notes")
sys_created_onTimestamp of journal entry
sys_created_byUser id of user that created the journal entry

Note that querying this table directly is not a documented feature, so the fields and functionality of the table are subject to change at ServiceNow's whim. Specifically, you're going to run into issues if you try modifying this table, as there is some back-end voodoo that happens that, as far as I can tell, keeps you from transferring journal entries from one ticket to another or re-attributing it.

Still, for specific tasks such as pulling info, it works well enough.