We've updated the ServiceNow Community Code of Conduct, adding guidelines around AI usage, professionalism, and content violations. Read more

how to copy work notes from TASK to RITM while closing task

Abhinab Achary1
Tera Guru

Hi All,

I have a catalog item   what i want is when i TASK i closed complete the user enters the work notes.. I want that the work notes entered while closing a TASK should get copied to its related RITM while closure

How can this be achieved.

Regards,

Abhinab

1 ACCEPTED SOLUTION

Before Update BR in Task table


Condition: current.work_notes.changes()


Script:


var gr = new GlideRecord('sc_req_item');


gr.get(current.request_item);


gr.work_notes = current.work_notes;


gr.update();


View solution in original post

5 REPLIES 5

abuthahir
Tera Expert

Use After Update BR to copy the content in Worknotes and query the sc_req_item table to find the associated RITM with the use of Requested Item field in Task level and update the RITM worknotes with the content you have copied.


i m little new to this. can u tell me the code i have to write


Before Update BR in Task table


Condition: current.work_notes.changes()


Script:


var gr = new GlideRecord('sc_req_item');


gr.get(current.request_item);


gr.work_notes = current.work_notes;


gr.update();


Thanks that worked.. i am not able to find the Correct Answer button to mark your answer correct and closed,, but one more thing how do I restrict for only two specific catalog item named as test1 and test2 only