Sending additional comments and work notes via rest api script

jyoti29208
Giga Expert

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

6 REPLIES 6

Nitesh Alashe1
Giga Expert

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

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

SP25
Kilo Contributor

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.

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;
}