Open sviriden opened 6 years ago
Hi @sviriden - I will provide an example tomorrow morning
Actually @sviriden I have a code sample I used in another project that I can post here...
protected function createAssignment($userId, $projectId, $startDate, $endDate, $allocation)
{
$data = array(
'assignment' => array(
'allocation' => $allocation, // Harvest is in hours, forecast requires seconds.
'end_date' => $endDate,
'person_id' => (string) $userId,
'project_id' => (string) $projectId,
'repeated_assignment_set_id' => null,
'start_date' => $startDate,
),
);
echo "\nCreate assignment";
$response = $this->forecast->postAssignment($data);
$assignment = $response['assignment'];
return $assignment;
}
I'll leave this issue open until we have documentation written that covers this
Oh, that project that uses this is public, too - if you want some additional examples https://github.com/caxy/harvest-forecast-sync/blob/master/src/Service/SyncService.php
Thanks a lot! Now everything works.
Hi,
Do you have any code example how to get work
postAssignment()
method? What should I pass as$data
parameter?