
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-29-2016 01:27 AM
Hi, how do we use setJournalEntry?
I tried setJournalEntry(current_record,'string i wanted');
is this wrong?
Thanks,
Tadz
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-29-2016 02:43 AM
Hi Cris,
You need to use it in following manner.
example as belows:
var fieldName = "work_notes"; // it can be work notes field or comments field
var incRec = new GlideRecord("incident");
incRec.addQuery("sys_id", sysId);
incRec.query();
if(incRec.next()){
incRec[fieldName].setJournalEntry("hello");
incRec.update();
}
format is as belows:
objectName[nameOfField].setJournalEntry("value you need to set");
Please mark this answer as helpful. This will work for sure.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-29-2016 02:43 AM
Hi Cris,
You need to use it in following manner.
example as belows:
var fieldName = "work_notes"; // it can be work notes field or comments field
var incRec = new GlideRecord("incident");
incRec.addQuery("sys_id", sysId);
incRec.query();
if(incRec.next()){
incRec[fieldName].setJournalEntry("hello");
incRec.update();
}
format is as belows:
objectName[nameOfField].setJournalEntry("value you need to set");
Please mark this answer as helpful. This will work for sure.
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-02-2018 06:51 AM
Hi Ankur,
Thanks for helpful post.
I would like to make an addition: If you add a user name to your code, you can define the journal entry's owner
objectName[nameOfField].setJournalEntry("value you need to set","user_name");
ie:
var vCloseStr = 'Change Cancelled as the state was New and the change has passed it\'s start date/time';
grCR['work_notes'].setJournalEntry(vCloseStr,'admin');

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-26-2021 08:09 AM
this code fails to execute for me...