LiquidPlanner Classic Forum

Ask a Question
Back to All

Able to add assignments to new task but can't set effort remaining

(edited)

Posted on behalf of steve seeley. Original posting date 2015-01-22.

In php when creating a new task I'm setting the 'assignments' property to an array of hashes. Each hash in the array is a single assignment (person and estimate). I'm successful in creating the assignments for the new task. But the estimates are not being set. As you can see below I've tried several different effort parameter names and formats (low vs. low_effort vs. low_effort_remaining). What is the proper format?

$newTaskAssignments = array();
foreach ($templateAssignments as $assignment) {
    $personId = $assignment->person_id == 0 ? $this->projectOwner->id : $assignment->person_id;
    //$newTaskAssignments[] = array('person_id' => $personId, "low" => $assignment->low_effort_remaining, "high" => $assignment->high_effort_remaining);
    //$newTaskAssignments[] = array('person_id' => $personId, "low_effort" => $assignment->low_effort_remaining, "high_effort" => $assignment->high_effort_remaining);
    //$newTaskAssignments[] = array('person_id' => $personId, "low_effort_remaining" => $assignment->low_effort_remaining, "high_effort_remaining" => $assignment->high_effort_remaining);
    $newTaskAssignments[] = array('person_id' => $personId, "low_effort_remaining" => "{$assignment->low_effort_remaining}h", "high_effort_remaining" => "{$assignment->high_effort_remaining}h");
}