I want to update a task item programatically in CSOM. Item is updating but workflow is not triggering. I need just to open the item in sharepoint and save it. Then workflow is triggering.
List requestTasksList = MyWeb.Lists.GetByTitle("TestRequest Tasks");
List<TestRequestModel> testRequestList = new List<TestRequestModel>();
ListItemCollection ColListItems = requestTasksList.GetItems(Spqur);
ctx.Load(ColListItems);
ctx.ExecuteQuery();
foreach (ListItem task in ColListItems)
{
task["Status"] = "Completed";
task["TaskOutcome"] = "Approved";
task["PercentComplete"] = 1.0;
task["Checkmark"] = 1;
task.Update();
requestTasksList.Update();
}
ctx.ExecuteQuery();
This is the updated task item
As i said, When i click to save button, workflow is triggering and new task is creating.