copy comments from one task to another task
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2014 05:38 AM
I have a requirement where I need to copy the comments entered in the first task to next task..
I have created a BR but no luck.. could anybody please help on this.
BR: push comments
when: before insert/update
script:
var gr = new GlideRecord('sc_task');
gr.addQuery('parent',current.sys_id);
gr.addQuery('short_description', "xyz");
gr.query();
while (gr.next()) {
var num = current.number;
gr.comments = current.comments.getJournalEntry(-1);
gr.update();
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2014 07:25 AM
Completely agree, Doug! I have actually run into exactly that situation in the past and used the workflow scratchpad as you indicate to solve it.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2014 09:22 AM
Here is an alternative solution you may find helpful:
Instead of copying comments from one task to another, consider adding sc_req_item.comments field to the sc_task form. This way people will be able to add comments from the catalog task form but all comments will actually be stored at the requested item level and will be visible in every task within the requested item.
Blog: https://sys.properties | Telegram: https://t.me/sys_properties | LinkedIn: https://www.linkedin.com/in/slava-savitsky/
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2014 11:22 AM
thanks a lot for all your help
my code is wrkng..:)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-21-2014 11:52 AM
awesome please mark this one as answered so people will know the solution is there and if you would mark the post that fixed it for you as the correct answer.
