Carry forward description from one task to another task.

prash4
Tera Expert

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.

5 REPLIES 5

AshishKM
Kilo Patron
Kilo Patron

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.

AshishKMishra_0-1700231389189.pngAshishKMishra_1-1700231457327.png

 

 

(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