
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-23-2016 06:42 AM
Hi all,
I found this article to copy task comments to the requested item: Copy Task Comments into Request Item History
What I have been asked to do is copy any work notes/comments from the project task to the parent project.
I've create a business rule, that does fire, but the information is NOT being transposed to the project. My ultimate goal is to get the work notes and comments from the task into the Activity area of the parent Project
gs.log('comment: ' + current.comments);
gs.log('wn: ' + current.work_notes);
var gr = new GlideRecord('pm_project');
gr.addQuery('sys_id', current.top_task.sys_id);
gr.query();
while (gr.next()) {
gr.setValue('comments',current.comment);**
gr.setValue('work_notes',current.work_notes);**
gr.update();
}
**again, I'd like these to appear in the Activity area of the parent project
Any help is greatly appreciated-
Solved! Go to Solution.
- Labels:
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-23-2016 08:34 AM
Here you go. Use this code in after business rule on project task table
When: after insert5 and update
Conditions Additional Comments Changes OR Work notes changes
Script:
var gr = new GlideRecord('pm_project');
if(gr.get(current.getValue('top_task'))){
if(current.comments.changes())
gr.comments=current.comments.getJournalEntry(1);
if(current.work_notes.changes())
gr.work_notes=current.work_notes.getJournalEntry(1);
gr.update();
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-19-2022 10:27 AM
Hi,
This works and I am able to copy task comments to parent incident, but in the task the comments are displayed twice. Any guess why it could be showing two times with in the task? Parent incident shows one time. Appreciate your help!
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎06-19-2022 10:27 AM
Hi,
This works and I am able to copy task comments to parent incident, but in the task the comments are displayed twice. Any guess why it could be showing two times with in the task? Parent incident shows one time. Appreciate your help!
Thanks
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎05-14-2024 05:57 AM
Thanks Abhinay !
It is running as mentioned.
My requiremnt is to display the worknotes on parent as well.
Worknotes from subtask to Task
Worknotes from task to sub-projets
Worknotes for sub-project to master
pleaase sugges modified BR

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-23-2016 09:45 AM
Glad you got this working.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-08-2017 06:55 AM
Thank you for this script, it works like a charm.
One quick question, how might I modify it so that it writes the project task number to the project (with a link to the project task), so the project manager has a quick way of knowing which project task the note came from?
thanks,
Richelle