3

I can't figure out how to set the EstimatedHours property from the StarTeam SDK. The property EstimatedHours is readonly, and I can't figure out any way to set the value from the SDK, though through the UI you can set the "Plan, Work" field.

Setting the EstimatedStart/Finish doesn't work:

var task = new Borland.StarTeam.Task(cr.ParentFolder);
task.Name = "Name";
task.Notes = "Notes";
// task.EstimatedHours = 4.0; // readonly property
task.EstimatedStart = DateTime.Now;
task.EstimatedFinish = DateTime.Now.AddHours(4);

task.Update();
Community
  • 1
  • 1
jasonpenny
  • 2,999
  • 1
  • 24
  • 23

1 Answers1

0

The only way I have figured out to set the Estimated Hours was with database access and a SQL query:

UPDATE t
   SET StTaskEstimatedHours = 4
FROM dbo.syn_Task t
WHERE t.EndModifiedTime = 0 AND t.DeletedTime = 0
  AND t.StTaskNumber = {task.Number}
jasonpenny
  • 2,999
  • 1
  • 24
  • 23