- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-28-2020 07:28 AM
Has anyone created a business rule that will copy the sc task comments to RITM in SP view?
Solved! Go to Solution.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-28-2020 07:39 AM
Hi John,
You need use write a before Update Business rule on Catalog Task table with condition as Additional comments changes which will copy comments to RITM. Something as below should help.
If it is worknotes you using then replace comments in code below with work_notes.
(function executeRule(current, previous /*null when async*/)
{
var com = "Catalog Task Comments for " + current.number + " : " + current.comments;
var v_gRITM = new GlideRecord('sc_req_item');
v_gRITM.addQuery('sys_id', current.request_item);
v_gRITM.query();
if (v_gRITM.next())
{
v_gRITM.comments= "Catalog Task Comments for " + current.number + " : " + current.comments;
v_gRITM.update();
}
})(current, previous);

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-28-2020 07:39 AM
Hi John,
You need use write a before Update Business rule on Catalog Task table with condition as Additional comments changes which will copy comments to RITM. Something as below should help.
If it is worknotes you using then replace comments in code below with work_notes.
(function executeRule(current, previous /*null when async*/)
{
var com = "Catalog Task Comments for " + current.number + " : " + current.comments;
var v_gRITM = new GlideRecord('sc_req_item');
v_gRITM.addQuery('sys_id', current.request_item);
v_gRITM.query();
if (v_gRITM.next())
{
v_gRITM.comments= "Catalog Task Comments for " + current.number + " : " + current.comments;
v_gRITM.update();
}
})(current, previous);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-28-2020 08:00 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎04-28-2020 08:08 AM
It comes from line.
var com = "Catalog Task Comments for " + current.number + " : " + current.comments;
replace it with
var com = current.comments;
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-18-2021 10:36 PM
this is very good and I have it working.
how would i get it to work the other way and write for item done to the task when the user updates the request item from the portal with out getting in a loop