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.

Script to write worknotes as a certain author

lss531
Tera Contributor

I currently have a script within a workflow that writes worknotes to the RITM seen below. I want the author of the worknotes to be "system", and not the last user to update the workflow causing the notes to be written (ex: Jan closes the task before the code runs, so it appears as if Jan wrote the worknotes).  

 

Script: 

var grRITM = new GlideRecord('sc_req_item');
grRITM.addQuery('number', current.getValue('number'));
grRITM.query();
while (grRITM.next()) {
    var worknote = "Worknote we are writing here";

    grRITM.work_notes = worknote;
    grRITM.update();
}
0 REPLIES 0