how to copy comments added on sctask to be showed in RITM additional comments ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-31-2025 08:47 AM
there is requirement, where we need to add additional comments (customer visible) on Sc task and when additional comments added in sctask that comments need to be copied in respective RITM additional comments section.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-31-2025 09:34 AM
You can create new business rule trigger on the sc_task table with condition "Additional comments" changes.
And Script to look up the parent RITM.
Use gr.comments = current.comment to copy comments to RITM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎01-31-2025 10:12 AM
@VedhR Create an onAfter update business rule on sc_task table and add a condition Additional comment changes.
Here is the script you can use in the business rule script field.
(function executeRule(current, previous /*null when async*/) {
if (current.request_item) {
// Query the related RITM. Use the 'request_item' field on the SCTASK.
var ritm = new GlideRecord('sc_req_item');
if (ritm.get(current.request_item)) {
// Get the new comments from the SCTASK.
var newComments = current.comments.getJournalEntry(1); // Get the last added comment
// Add the comment to the RITM. Use 'work_notes' if it's internal, 'comments' for customer-visible.
ritm.comments = newComments; // or ritm.work_notes = newComments; for internal notes
// Important: Update the RITM record.
ritm.update();
// Optional: Add a work note to the RITM indicating the comment was copied.
// ritm.work_notes = "Comment copied from SCTASK: " + current.number;
// ritm.update();
} else {
// Handle the case where the RITM is not found (log an error).
gs.error("RITM not found for SCTASK: " + current.number);
}
}
})(current, previous);