AssignmentData#

An assignment record: it books value units of one resource on one task. It appears as an entry of assignments in ProjectData and of assignments.add in SchedulingChanges. With offset and duration, it books only a slice of the task's work. Slices change resource load, never task dates.

Fields#

Field Type Required Default Description
id Id | null no generated The assignment's id. Must be unique among assignments. When omitted or null, the engine generates $generated_assignment_1, $generated_assignment_2, and so on, skipping ids already in use.
task Id yes - The task the assignment books. task_id is accepted as an alias; when both are present, task wins.
resource Id yes - The resource booked. resource_id is accepted as an alias; when both are present, resource wins.
value number yes - Units of the resource booked, in the same units as the resource's capacity. 1 = 100 %. Must be finite and greater than 0.
offset number | null no 0 Where the slice starts, as worked time from the task start, in the task's duration_unit. Must be finite and at least 0.
duration number | null no to the task end Worked time the slice books, in the task's duration_unit. Must be finite and greater than 0.

Fields not in this table are ignored, including an assignment mode. How unknown fields are handled across the wire is described in Wire format.

How slices book load, including clipping at the task end and overlapping slices, is covered in Resources and assignments.

An assignment whose task is unscheduled stays in the project but is inactive; the result reports it with a dropped-assignment note. See Resources and assignments.

Errors#

A missing or null task, resource or value fails the call with parse and no path (see Required fields). Under strict validation, the record also fails with validation at these paths:

Path When
assignments[i].id The id is already used by another assignment.
assignments[i].task No task has this id.
assignments[i].resource No resource has this id.
assignments[i].value value isn't finite or is 0 or less.
assignments[i].offset offset isn't finite or is less than 0.
assignments[i].duration duration isn't finite or is 0 or less.
assignments[i] In calendar_mode: "resource", the task calendar and the resource calendar share no weekly working time.

In assignments.add of a change set, the same problems reject that operation instead. Repair validation clears an invalid offset or duration and adds a note; see Accept messy input.

Used by#

Example#

A whole-task assignment at 50 %, and two people splitting one task's work: the first 2 units of work, then the rest.

{
  "assignments": [
    { "id": "a1", "task": "design", "resource": "anna", "value": 0.5 },
    { "id": "a2", "task": "build", "resource": "anna", "value": 1, "duration": 2 },
    { "id": "a3", "task": "build", "resource": "ben", "value": 1, "offset": 2 }
  ]
}