Sending additional comments and work notes via rest api script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-02-2020 10:39 PM
Hi All,
I need to pass work_notes and additional comments of an incident via rest API.
Could you please help me how it can be done in BR.
Regards,
Jyoti

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-02-2020 10:47 PM
Hello,
you can use this script in BR to get the latest comments and work notes
if you want all the comments and worknotes just replace 1 to -1.
current.comments.getJournalEntry(1);
current.work_notes.getJournalEntry(1);
BR
Nitesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
12-17-2020 08:42 AM
i used in a different but similar context:
ebonding two instances with integrationhub! can use this in the payloadbuilder script to only grab the latest update to comments or worknotes instead of pulling the whole stream. Thanks Nitesh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-07-2021 05:18 PM
HI Les,
How did u use it in payload script? i am trying to do the same. Need to add work notes and additional comments in payload builder script in integration hub.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-19-2021 09:00 AM
This code snippet might work for you. I use it for eBonding Case
var caseSysId = case_sys_id;
var caseRec = new GlideRecord('sn_customerservice_case');
caseRec.get(caseSysId);
var workNotes = caseRec.work_notes.getJournalEntry(-1).toString();
if(workNotes) {
caseValues.work_notes = workNotes;
}