- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-02-2016 08:08 AM
Is there a script available that copies the worknotes entered on a catalog task back to the parent RITM record? We are using the RITM record to provide status back to the users via the portal.
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-02-2016 08:15 AM
Hi James,
Nothing out of the box, but you could create a business rule that does this easily enough.
Name: Copy task work notes to RITM
Table: Task (sc_task)
Insert: checked
Update: checked
When: After
Advanced: checked
Condition: Work notes Changes (or in the condition field: current.work_notes.changes())
Script:
(function executeRule(current, previous /*null when async*/) {
var gr = new GlideRecord('sc_req_item');
if (gr.get(current.parent)) {
gr.work_notes = current.work_notes;
gr.update();
}
})(current, previous);
You said work notes. Change to 'comments' where appropriate if that's what you meant.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-02-2016 08:15 AM
Hi James,
Nothing out of the box, but you could create a business rule that does this easily enough.
Name: Copy task work notes to RITM
Table: Task (sc_task)
Insert: checked
Update: checked
When: After
Advanced: checked
Condition: Work notes Changes (or in the condition field: current.work_notes.changes())
Script:
(function executeRule(current, previous /*null when async*/) {
var gr = new GlideRecord('sc_req_item');
if (gr.get(current.parent)) {
gr.work_notes = current.work_notes;
gr.update();
}
})(current, previous);
You said work notes. Change to 'comments' where appropriate if that's what you meant.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-02-2016 08:33 AM
Thanks Chuck. This worked perfectly.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-02-2016 08:38 AM
That's good. It was untested.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-29-2016 07:04 AM