work_notes values is coming empty while trying to create an Incident using Glide Record

kamaldev
Kilo Explorer

var gr = new GlideRecord('incident');

gr.initialize();

gr.short_description='Ticket Account' ;

gr.caller_id=workflow.scratchpad.userFullName;

gr.location=workflow.scratchpad.userLocation;

gr.work_notes='This is a high-priority incident.' ;

gr.insert();

gs.addInfoMessage('Ticket Created');

Here is my script which I have written in a workflow to create a ticket . Everything is getting inserted except the work_notes

Please help out !

11 REPLIES 11

Midhun1
Giga Guru

Hi Garg,



current.work_notes.getJournalEntry(-1);


hey midhun,



i am very new to this .



current.work_notes.getJournalEntry(-1);



is this like creating a variable first and where can i add my data ?



thanks in advance .




Jim Coyne
Kilo Patron

Are you sure?   The work_notes field is a special type of field called Journal (Using Journal Fields - ServiceNow Wiki) which always appear empty on a form.   They are meant to allow users to enter new journal entries, and do not necessarily display the contents of the field.



Check the Activity formatter on the Incident form to see if your work note appears there.


Here's a screenshot to show you what happens with Journal fields:


find_real_file.png



The field itself is blank, but the previous entries appear in the Activity formatter, which may or may not be near the Work notes field.   Here's some information on the Activity formatter - Activity Formatter - ServiceNow Wiki