How can I add worknote to existing RITM record programmatically?

Rajanmehta
Mega Guru

Hello 

We are on Jakarta. I have a existing record of REQ and RITM with known sys_id. I want to add an additional worknote to RITM on top of previous worknotes. How can I add programmatically. 

I added new record in Journal entry table with RITM sys_id as Element ID, but this newly added worknote is not visible in RITM record. I tried adding as work_notes and work_notes_list, but no luck.

What should I do to update this record so that new worknote is visible? Please advise. 

Thanks,

Rajan Mehta

 

find_real_file.png

 

1 ACCEPTED SOLUTION

Mike Patel
Tera Sage

If you know the sysid than you can write directly to RITM. Do something like

var sysid = 'xxxxxxxx';

var req = new GlideRecord('sc_req_item');
req.get(sysid);
req.work_notes = 'Comment notes etc';
req.update();
}

View solution in original post

2 REPLIES 2

Mike Patel
Tera Sage

If you know the sysid than you can write directly to RITM. Do something like

var sysid = 'xxxxxxxx';

var req = new GlideRecord('sc_req_item');
req.get(sysid);
req.work_notes = 'Comment notes etc';
req.update();
}

Thanks Mike.

That worked very well. I used it as below.

(function(){

var req = new GlideRecord('sc_req_item');
req.addQuery('sys_id',"3c67d25fdbea17c0bb4470e21f961928");

while(req.next()){
req.work_notes = ('Comment notes etc');
req.update();
}

})();