Duplicate additional comments /Work notes getting created
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-26-2023 11:45 AM
Have before BR on RITM and Task table with condition additional comments or work notes changed. It is creating duplicate additional comments and worknotes entry.
BR on RITM
var comment;
var grtask = new GlideRecord('sc_task');
grtask.addQuery('parent', current.sys_id);
grtask.query();
if (grtask.next()) {
comment = current.comments;
grtask.comments = comment;
grtask.work_notes = current.work_notes;
grtask.update();
}
BR on SC Task
var gr = new GlideRecord('sc_req_item');
gr.get(current.request_item);
gr.comments = current.comments;
gr.work_notes = current.work_notes;
gr.update();
gr.get(current.request_item);
gr.comments = current.comments;
gr.work_notes = current.work_notes;
gr.update();
Please if anyone can help me on this.
1 REPLY 1
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-26-2023 01:11 PM
Hi @nkumari,
It is probably going into a loop, that's why you can see multiple worknotes
Please refer to the solution given by Sravani44 on this thread, it should work for you:
https://www.servicenow.com/community/developer-forum/sync-ing-ritm-and-sctask-work-notes-additional-...
If my answer has helped with your question, please mark it as correct and helpful
Thanks!