Carry forward description from one task to another task.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-17-2023 06:08 AM
I have requirement where when a user is filling description in task1 and close complete that task, then that description in task1 should carry forward to task2 and other subsequent tasks.
please help me with the code.
Thank you.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-17-2023 06:33 AM - edited ‎11-17-2023 06:33 AM
Hi @prash4 ,
In this case, you can write a BR [update ] on sc_task and find the other task belongs to same RITM and update the description. BTW, how you are creating those task , are they not created via workflow and this description field is part of variables or part of task.
You can replicate the below BR and test it , this BR will update all active task belong to same ritM.
(function executeRule(current, previous /*null when async*/) {
// Add your code here
var otherTasks = new GlideRecord("sc_task");
otherTasks.addQuery("request_item", current.request_item); // current.request_item is sys_is of RITM
otherTasks.query();
while(otherTasks.next()){
otherTasks.description = current.description;
otherTasks.update();
}
})(current, previous);
-Thanks,
AshishKMishra
Please mark this response as correct and helpful if it helps you can mark more that one reply as accepted solution