I need to copy comments (Additional comments) from incident task record to its Parent Incident record? Any script ?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-26-2017 06:34 AM
I need to copy comments (Additional comments) from incident task record to its Parent Incident record? Any script ?
- Labels:
-
Scripting and Coding
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-26-2017 06:37 AM

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-26-2017 06:40 AM
Hi Scotty,
It really depends WHEN you want to copy the comments. if you wish to do this when the child incident is saved, then an AFTER business rule like the following would work. Note this is untested...
(function executeRule(current, previous /*null when async*/) {
var parent = new GlideRecord('incident');
if (parent.get(current.getValue('parent')) {
parent.comments = current.comments.getJournalEntry(1);
parent.update();
}
})(current, previous);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-04-2018 02:02 AM
Hi Chuck,
Appreciate this was written a long time ago. Any idea how I would get the Task ID included in this update? At the minute its displaying the comments that have been added but there is no reference as to where it has come from. Any help would be great.
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎09-26-2017 06:45 AM
HI Scotty,
Please find the below link it may help you
Copy Project task comments/work notes to parent project
Please provide your feedback appropriately (Like, Helpful, Endorse AND/OR Correct) to help community.