Copy Worknotes from RITM to Request

Samiksha2
Mega Sage

Hi All,

 

I need to copy RITM work notes for a particular catalog item.

I am not sure what to add in the query.

Please help.

Thanks,

Sam

2 ACCEPTED SOLUTIONS

Harish KM
Kilo Patron

Hi @Samiksha2 Create a after update BR

cond: item is "your catalog"

script:

var workNotes = current.work_notes.getJournalEntry(1);
var app = new GlideRecord('sc_request');
app.addQuery('sys_id', current.request);
app.query();
if(app.next()){
app.work_notes = "workNotes Updated " +workNotes;
app.update();
}

View solution in original post

14 REPLIES 14

Hi @Dr Atul - LNG ,

 

That doesn't work for Request to RITM.
I dont know what should be the query. 

var gr = new GlideRecord('sc_request');
        gr.addQuery('here');
        gr.query();
        while (gr.next()) {
            gr.comments = current.comments;
            gr.work_notes = current.work_notes;
            gr.update();
 
 
Thanks,
Sam

Hi @Dr Atul - LNG ,

I added this query.

var grs = new GlideRecord('sc_request');
        grs.addQuery('sys_id', current.request.sys_id);
        grs.query();
        while (grs.next()) {
            //grs.comments = current.comments;
            grs.work_notes = current.work_notes;
            grs.update();
        }
What is the error here?
It is not working.
 
Thanks,
Sam

Hey @Dr Atul - LNG ,

 

It is working now.

 

Thanks,

Sam