Journal field script values

The setValue() method is not supported for journal fields. Instead, assign values in script as in the following example.

var gr = new GlideRecord('incident');
 
//query priority 1 incidents in the state of either 'new' or 'active'.
gr.addQuery('priority', 1);
var gc = gr.addQuery('state', 1);
gc.addOrCondition('state', 2);
gr.query();
 
while(gr.next())
{
 
//print a list of the incident numbers updated
gs.print(gr.number);
 
//add an entry to the 'work notes' journal field for each incident
gr.work_notes = "This is a high-priority incident. Please prioritize.";
gr.update();
}