Task not updated in RS TaskGroup script

I created a task update script on my RS TaskGroup server. It must change the value of the task each time the task is updated. Unfortunately, this does not update the task.

function Handle_Before_UpdateTask (UpdatedTask, OrigTask)
{
  UpdatedTask.progress = 0;
  rstg.updateTask (UpdatedTask);
  return true;
}
+4
source share
1 answer

You should not call rstg.updateTask inside the handle functions. It should be used only for tasks read from the database, for example through rstg.getTaskById. See Documentation https://www.raikosoft.de/script-api/rstg/

You can simply skip rstg.updateTask in the task represented by the UpdateTask parameter. The server automatically applies your changes to this task before storing them in the database.

+1

Source: https://habr.com/ru/post/1616707/