- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-12-2018 05:29 AM
Hi
I am looking for a Business rule to copy Additional comments from task to the corresponding RITM
So far I have this:
Table = sc_task
When = After
Insert and Update = check
Condition = current.comments.changes()
Script
(function executeRule(current, previous /*null when async*/) {
//
var gr = new GlideRecord('sc_task');
gr.addQuery('request_item',current.sys_id);
gr.query();
while(gr.next()){
gr.comments = current.comments;
gr.update();
}
//
})(current, previous);
Many thanks in advance
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-12-2018 05:46 AM
var gr = new GlideRecord('sc_req_item'); //it should be on sc_req_item table
gr.addQuery('sys_id',current.request_item);
gr.query();
while(gr.next()){
gr.comments = current.comments;
gr.update();
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-12-2018 05:46 AM
var gr = new GlideRecord('sc_req_item'); //it should be on sc_req_item table
gr.addQuery('sys_id',current.request_item);
gr.query();
while(gr.next()){
gr.comments = current.comments;
gr.update();
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-12-2018 05:57 AM
Thank you!!!

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-12-2018 05:47 AM
You can use something like this:
var gr = new GlideRecord('sc_req_item');
gr.get(current.request_item);
gr.comments = current.comments;
gr.update();
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-12-2018 05:57 AM
This one is correct as well