Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

how to copy the CTASK close note to CR worknotes

VIKAS MISHRA
Tera Contributor

I want to copy the close not of CTASK to CR work notes, but the script is not working for CR works notes only.

If i use gr.description instead of gr.work_notes then it copy the Close note and past it to CR description filed, but when i am using "gr.work_notes" then it's not pasting the CTASK close notes to CR worknote, please suggest.

var gr = new GlideRecord("change_request");
	gr.addQuery("sys_id", current.change_request);
	gr.query();
	if (gr.next()) {
		gs.log('test3');
gr.work_notes = current.close_notes;
    gr.update();

}

 

1 ACCEPTED SOLUTION

J Siva
Kilo Patron

Hi @VIKAS MISHRA 
Try the below script. It'll work.

 var crq = new GlideRecord("change_request");
    crq.addQuery("sys_id", current.change_request);
    crq.query();
    if (crq.next()) {
        crq.work_notes.setJournalEntry(current.close_notes);
        crq.update();

    }

Regards,
Siva

View solution in original post

1 REPLY 1

J Siva
Kilo Patron

Hi @VIKAS MISHRA 
Try the below script. It'll work.

 var crq = new GlideRecord("change_request");
    crq.addQuery("sys_id", current.change_request);
    crq.query();
    if (crq.next()) {
        crq.work_notes.setJournalEntry(current.close_notes);
        crq.update();

    }

Regards,
Siva