Add additional comments to RITM and Task
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-21-2020 06:44 AM
Will this script work to copy additional comments from RITM to Task and Task to RITM whichever one is updated with additional comments?
(function executeRule(current, previous /*null when async*/)
{
var com = 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= current.comments;
v_gRITM.update();
}
})(current, previous);
(function executeRule(current, previous /*null when async*/) {
updateTasks();
function updateTasks() {
var sctask = new GlideRecord('sc_task');
sctask.addQuery('request_item', current.sys_id);
sctask.query();
while (sctask.next()) {
sctask.work_notes = 'Additonal Comment from RITM' + current.comments;
sctask.update();
}
}
})(current, previous);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-22-2020 07:49 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-22-2020 07:50 AM
And when I add comments in task it doesn't even show up in the RITM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-22-2020 11:47 AM
Updated above as .getJournalEntry(-1) was missing.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-30-2021 09:11 AM
Hello Jaspal,
Thank you for this. .getJournalEntry(-1) was missing from where?
I am getting the same output 'RITM Comments for RITM0010639:" and nothing else. It does not actually move the comment value.
Any help on this is greatly appreciated. Have a great day!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-06-2023 10:44 PM
Please update below line in your code-
as catis.comments = "Catalog task comments for "+current.number+" :"+current.comments.getJournalEntry(-1);
If this solution helps you ,mark it as a correct
Thanks,
Manjusha Bangale