Insert to work Notes as opposed to comments.

vinod6
Tera Contributor

Use case:

In case number CS0341414, I initially added a comment, but I need to move it to the work notes instead of the public comments. Specifically, I want to insert "A server is not working." into the Internal Notes(work notes) as opposed to Public Notes(Additional comments). Additionally, the comment should be cleared from the Additional Comments section and added only to the Work Notes.
In this case I wort a Before business Rule : Insert and update.
Condition: Case number      is         CS0341414
Script:

var message = current.comments;
current.work_notes = message; // Add message to Internal Notes
current.comments = ''; // Clear the public note


I want to update the this script only this Case number  CS0341414.
Could you please help on this one.
4 REPLIES 4

Debasis Pati
Tera Guru

Hello @vinod6 ,

Please try the below
// Condition: Case number is CS0341414
if (current.number == 'CS0341414') {
var message = current.comments;
current.work_notes = message; // Add message to Internal Notes
current.comments = ''; // Clear the public note
}

If this helps you please mark it as correct/helpful

Rohit  Singh
Mega Sage

Hi @vinod6 ,

 

Do you want to get this done as one time activity or for this case you want every additional comments to be cleared and posted as work notes? 

If one time then do it by a fix script else BR.

 

What's the issue you are facing here ?

 

Regards,

Rohit   

Ankur Bawiskar
Tera Patron
Tera Patron

@vinod6 

so what debugging have you done?

what's your analysis?

If my response helped please mark it correct and close the thread so that it benefits future readers.

Regards,
Ankur
✨ Certified Technical Architect  ||  ✨ 9x ServiceNow MVP  ||  ✨ ServiceNow Community Leader

Swapna Abburi
Mega Sage
Mega Sage

Hi @vinod6 

If you want to delete entry made to additional comments on a particular case and add it to work notes, you can go to sys_journal_field table to delete the specific comments.