Viewing last two comments when using getJournalEntry to add a journal entry to a notificationDescriptionWhen a comment in a notification contains two new-line characters, the last comment is split. ServiceNow product documentation explains that when a journal entry is added to a notification using getJournalEntry, the separation between comments can be done using \n\n: var notes = current.work_notes.getJournalEntry(-1); //gets all journal entries as a string where each entry is delimited by '\n\n'var na = notes.split("\n\n"); //stores each entry into an array of strings for (var i = 0; i < na.length; i++) gs.print(na[i]); Unfortunately, when a comment contains two new-line characters, it is the last comment itself that is split. There are two cases: CASE 1 (expected behavior) Log into instance XXX as user XXX. Navigate to Incident > Open.Click one of the incidents in the list.Add an Additional comment that includes two back-to-back new-line characters, followed by additional text. For example:"Hi there,<new-line character><new-line character>How are you?Click Update or Save.The system interprets the comment you entered as a single entry. The comment with the new-line characters appear together and are followed by the previous comment that was already in the notification: Comment:-------------- "Hi there, How are you? -------------------------- <Previous comment> var notes = current.work_notes.getJournalEntry(-1); //gets all journal entries as a string where each entry is delimited by '\n\n' var na = notes.split("\n\n"); CASE 2 (unexpected behavior) Send in an email in reply to an Incident in the system so that a comment is registered with the email's contents. Make sure it includes two back-to-back new-line characters followed by additional text. For example:"Hi there,<new-line character><new-line character>How are you?When the email is added to the Additional comments, it will cause an outgoing "incident.commented" event/email.The email that goes out interprets the comment you entered as two different entries. The result in the notification sent after the comment was added is NOT the two last comments, but the following: Comment: -------------- Hi there, -------------------------- <previous comment> _______________ How are you? Steps to Reproduce No steps to reproduce available at this time.WorkaroundUse a GlideRecord query on the sys_journal_field table to find each individual journal entry, rather than parsing for linebreaks. This table stores each journal entry seprately and therefore there would be no need to split on "\n\n". See example starting point below: var gr = new GlideRecord('sys_journal_field');gr.addQuery('element_id',current.sys_id);gr.addQuery('name','task');gr.query();while( gr.next() ) { gs.print( gr.element + ' = ' + gr.value );}Related Problem: PRB591140