- 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
09-29-2016 07:11 AM
Try
if (gr.get(current.request_item))
instead of current.parent on line 4.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-29-2016 07:18 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-29-2016 07:19 AM
Anything to do with these fields being journal fields?

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-29-2016 07:21 AM
No, it will still detect the condition Work notes changes.
Did you turn on business rule debugging and see if it is meeting the condition?
System Diagnostics> Debug Business Rule (details) and then try again and observe the output at the bottom.
Debugging Tools Best Practices - ServiceNow Wiki
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-29-2016 07:32 AM