Add comment when state changes

Athena Mathews
Tera Contributor

Hello,

we have a notification which is sent whenever a custom state field changes to a particular choice (say the choice is "solution required")

we have different scripts where we are setting state value to "solution required" sometimes when comments are added and sometimes when worknotes is added. (This is based on some conditions).

In the notification, we have a line "Info to be noted" under which we are currently sending latest comment added on the ticket. but as mentioned, sometimes, we have the latest info in worknotes and not comments.

How do we send email notification so that under our "Info to be noted", the receiver finds the latest info be it worknotes or comments which ever is sent latest during the state change to "solution required".

1 ACCEPTED SOLUTION

Adrian Ubeda
Mega Sage
Mega Sage

Hi Athena, 

 

There's the Journal Entries table [sys_journal_field] that stores both notes, work notes and additional comments. You can query that table with element_id=sys_id_record, and then retrieve data from value field which contains the text posted in work notes/additional comments.

Maybe this thread is useful: https://www.servicenow.com/community/itsm-forum/how-to-trigger-notification-when-work-notes-or-addit...

If it was helpful, please give positive feedback! ✔
☆ Community Rising Star 22, 23 & 24 ☆

View solution in original post

1 REPLY 1

Adrian Ubeda
Mega Sage
Mega Sage

Hi Athena, 

 

There's the Journal Entries table [sys_journal_field] that stores both notes, work notes and additional comments. You can query that table with element_id=sys_id_record, and then retrieve data from value field which contains the text posted in work notes/additional comments.

Maybe this thread is useful: https://www.servicenow.com/community/itsm-forum/how-to-trigger-notification-when-work-notes-or-addit...

If it was helpful, please give positive feedback! ✔
☆ Community Rising Star 22, 23 & 24 ☆