Update TimeSheet

PUT {{baseUrl}}/odata/TimeSheets(00d44ecd-c005-450c-b910-dcdc4aecc463)

TimeSheet entity:

  • id - identifier (GUID).
  • name — string (arbitrary, updated automatically on the server).
  • rowVersion - current timesheet version. If it differs from the saved one, an exception will be generated, after the update a new version is automatically generated.
  • timeSheetLines - an array of lines, in the example one line.

TimeSheetLine entity:

  • id - identifier (GUID).
  • projectId, projectTaskId, activityId, roleId — identifiers of the selected analytics (project, task, work type, and role). Please note that it is not the object (project, activity...) that is passed, but the object id (projectId, activityId...).
  • orderNumber: the ordinal number of the row. The numbering must be from 0 and must be strictly sequential. This is checked by the server and if the numbering is violated, there will be an exception.
  • timeAllocations - a collection of cells of the string.

TimeAllocation entity:

  • id - identifier (GUID).
  • date is the date of the cell.
  • comments — text comment
  • duration — duration of work in hours.

Related collections (in this case, timeSheetLines and timeAllocations) will be updated automatically when the timesheet is updated.

Request Body

{"id"=>"00d44ecd-c005-450c-b910-dcdc4aecc463", "name"=>"name", "rowVersion"=>12630001, "timeSheetLines"=>[{"id"=>"172ab42a-bacd-459a-bfea-56056c8f9272", "timeAllocations"=>[{"id"=>"0164f849-611e-4f10-a813-b4a39172aecd", "duration"=>4.5, "comments"=>"Text comment", "date"=>"2022-08-15"}, {"id"=>"0164f849-611e-4810-a813-b4a39172aecd", "duration"=>8, "comments"=>"Text comment", "date"=>"2022-08-16", "stringValue1"=>"some custom field attribute"}], "projectId"=>"2fa44ea0-df3b-47f0-bc62-fea3554c6c3c", "activityId"=>nil, "projectTaskId"=>"125cc1dd-8dac-46d9-be75-4547c68e390c", "orderNumber"=>0}]}