Forum Discussion

Vasily_Zaytsev's avatar
Vasily_Zaytsev
Iron Contributor
Apr 18, 2022

Why IsMilestone Task property Can I set on second publication via CSOM?

Hello.

Why IsMilestone Task property Can I set on second publication via CSOM?

I have this code:

csom.DraftProject draft = project.CheckOut();
context.Load(draft.Tasks, dt => dt.Where(t => t.Id == taskUID));
context.ExecuteQuery();
csom.DraftTask task = draft.Tasks.First();
task.ActualStart = task_Act_Start;
task.ActualFinish = task_Act_Start;
task.PercentComplete = 100;
task.IsLockedByManager = true;
task.IsMilestone = true;
draft.Update();
csom.JobState jobState = context.WaitForQueue(draft.Publish(true), Consts.DEFAULTTIMEOUTSECONDS);

BUT task.IsMilestone = true; works only after second publication:

csom.DraftProject draft = project.CheckOut();
context.Load(draft.Tasks, dt => dt.Where(t => t.Id == taskUID));
context.ExecuteQuery();
csom.DraftTask task = draft.Tasks.First();
task.IsMilestone = true;
draft.Update();
csom.JobState jobState = context.WaitForQueue(draft.Publish(true), Consts.DEFAULTTIMEOUTSECONDS);

How can I do it with one publication?

 

No RepliesBe the first to reply

Resources