Script to write worknotes as a certain author
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-16-2024 01:03 PM
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