Worknotes from one task to another task
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2020 09:16 AM
HI All,
I have a requirement where tasks get created parallel for a catalog item,
Req--> RITM--> Task 1, Task 2 etc are created. Now when I complete task 1 and add comments, they should populate to task 2. From Task 2 to Task 3 so on.
Any help is highly appreciated.
Thanks!!
Rekha
- Labels:
-
Request Management
-
Service Catalog

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2020 09:26 AM
Use a business rule or flow designer flow to query all SCTASKs that have the same RITM ID as the one that was updated, and then update the work notes on the SCTASKs.
Example:
var sct = new GlideRecord("sc_task");
sct.addEncodedQuery("request_item=" + current.request_item + "^sys_id!=" + current.sys_id);
sct.query()
sct.setValue("work_notes", "Work Note copied from SC Task " + current.number + "\n" + current.work_notes);
sct.updateMultiple();
Of course, you can do the same with any field, including customer comments.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2020 09:47 AM
Hi,
Use this script
(function executeRule(current, previous /*null when async*/) {
var gr = new GlideRecord('sc_task');
gr.addQuery('request_item', current.sys_id);
gr.query();
while(gr.next()) {
gr.comments = "Comment added from: " + current.number + "\r\n" + "> " + current.comments;
gr.update();
}
})(current, previous);
Thanks,
Ashutosh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-24-2020 09:56 AM
You cannot achieve this using workflow
You need to have after update BR with condition as your catalog item and current short description matching your Task 2
BR: After Update
Condition: Comments changes && Current RITM-> Catalog Item-> Your Catalog Item && Short Description == Task 2 description
Sample Script Below
(function executeRule(current, previous /*null when async*/) {
var gr = new GlideRecord('sc_task');
gr.addQuery('request_item', current.request_item);
gr.orderBy('sys_created_on'); // this will pick the 1st task
gr.setLimit(1);
gr.query();
if(gr.next()){
gr.comments = current.comments;
gr.update();
}
})(current, previous);
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader