Copy Worknotes from one task to another

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-27-2018 01:45 AM
Hi Everyone,
I have this requirement where I have two catalog task in which when 1 task updated their worknotes it should reflect to the other task.
The issue is, since they are on the same table sc_task. Whenever i tried to do a gliderecord and update it will reflect back to the current updated record. Causing it to be duplicated.
My Approach is an On Before Business Rule.
with the following script:
var gr = new GlideRecord("sc_task");
gr.addQuery("request_item", current.request_item);
gr.addQuery("number", "!=", current.number);
gr.query();
if (gr.next()) {
gr.work_notes = current.work_notes;
gr.update();
}
Is there a way to update without causing the current record to be updated again? I already tried setworkflow(false) but its not working.
Thanks in advance!
Tadz

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-27-2018 03:30 AM
current.work_notes.getJournalEntry(1);
Also make sure you use while instead of if block. because while will get all the task

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-27-2018 02:52 AM
let me know if you need any further help here.
if i answered your query, mark my answer correct and close this thread.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎12-12-2019 05:36 AM
Hi Guy's
I need a little help modifying the referenced code above in a 'after BR'. I would like the work notes of task 1 to be passed to Task 2 only after task 1 is closed.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-21-2020 12:44 PM
As Harshvardhan mentioned, you need to add one more condition to the business rule
Note: use After Business rule and set the condition : worknotes changes + task state is closed completed
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-21-2020 06:38 AM
Any solution to this