Work notes only copied to one task, not all
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi
My business rule isn’t working as expected. What am I missing? When I add work notes to Task 1, they only update Task 2, but Task 3 doesn’t get any of the notes. It seems to copy notes from Task 1 to Task 2, but Task 3 remains unchanged
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Does 'Task 3' exist at the time that work notes are updated on 'Task 1'?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
No, so Task1 is generated once its closed completed then Tsk2 is generated then closed completed then Task3..
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Since your existing Business Rule is working for all of the tasks that exist at the time the work notes are added, you'll need another BR to run before Insert on the sc_task table, to copy all work notes (use ...getJournalEntry(-1) from one of the existing tasks to the new task, since all tasks should in theory have the same work notes.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
Hi @CarolMa6 ,
Your current Business Rule runs after update on existing tasks.
- At the time Task 1 closes, only Task 2 exists, so Task 3 can’t be updated yet.
- When Task 3 is later created, it doesn’t automatically inherit the notes that were already copied to Task 2.
That’s why you need another Business Rule on insert for sc_task:
- It ensures that when a new task (like Task 3) is generated, it immediately receives all the existing work notes from its siblings.
- Using getJournalEntry(-1) is the right approach, because it retrieves all journal entries, not just the latest one.
Create a Before Insert Business Rule on sc_task:
(function executeRule(current, previous) {
var gr = new GlideRecord("sc_task");
gr.addQuery("request_item", current.request_item);
gr.addQuery("number", "!=", current.number);
gr.query();
while (gr.next()) {
var notes = gr.work_notes.getJournalEntry(-1); // get all notes from sibling
if (notes) {
current.setWorkflow(false);
current.setJournalEntry("work_notes", notes);
}
}
})(current, previous);
Best Practice
- Keep your existing “after update” rule → propagates new notes forward.
- Add this “before insert” rule → backfills notes into newly created tasks.
- Together, they ensure every task under the same RITM stays in sync, regardless of when it’s created.
- After Update → propagate notes when they’re added.
- Before Insert → backfill notes when new tasks are created.
If my response helped please mark it correct and close the thread so that it benefits future readers.
Best,
Anupam.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
3 weeks ago
@CarolMa6 , fix this — you need to grab the work notes from the journal field, like this:
gr.work_notes = current.work_notes.getJournalEntry(1 );
Rampriya S