TaskUpdate#
A partial edit of one existing task, matched by id. Goes in tasks.update of a SchedulingChanges object. Every field except id is optional: a field left out keeps its stored value.
Fields#
The fields have the same meaning as in TaskData. Each field has three states:
- left out (or
undefined): the stored value stays null: clears an optional field, or restores the default of a field that has one- a value: replaces the stored value
| Field | Type | Default | Description |
|---|---|---|---|
id |
Id |
required | Id of the task to edit. |
parent |
Id | null |
unchanged | New parent task. A value equal to config.root_id, or "", means no parent. |
start_date |
DateValue | null |
unchanged | New start. |
end_date |
DateValue | null |
unchanged | New end. |
duration |
number | null |
unchanged | New duration, in working time, in the task's duration_unit. |
constraint_type |
ConstraintType | "" | null |
unchanged | New constraint. "" and null both clear it. |
constraint_date |
DateValue | null |
unchanged | Date of the constraint. |
auto_scheduling |
boolean | null |
unchanged | Whether the planner moves the task. |
unscheduled |
boolean | null |
unchanged | Marks the task as unscheduled. |
progress |
number | null |
unchanged | Completion of the task. |
calendar_id |
Id | null |
unchanged | Calendar of the task. |
priority |
number | null |
unchanged | Leveling priority. |
leveling_delay |
number | null |
unchanged | Leveling delay, in elapsed time in the task's duration_unit. With no date in the same update, the stored start moves by the difference, snapped onto the working calendar. |
pauses |
Pause[] | null |
unchanged | Replaces the whole list; null clears it. With no date in the same update, start and duration stay and the end is recomputed. |
type and duration_unit can't be changed through an update.
An update without dates, pauses or leveling_delay keeps the task's stored start and duration. Fields not listed above are ignored. An entry of ScheduleResult.updates is therefore a valid TaskUpdate: its kind and reason are ignored. To clear leveling on a task, set pauses: [] and leveling_delay: 0.
Used by#
Project#apply:changes.tasks.updateedits the accepted stateProject#preview:changes.tasks.updateedits a copy of the baselineProject#evaluate: each candidate'schanges.tasks.updateProject#suggestAssignments: withclearFirst: true, the cleared delays and pauses come back inchanges.tasks.update
Example#
const = ;
Related#
SchedulingChanges- the change set that holds updatesTaskData- the meaning of each fieldProject#apply- committing an update- Editing a project - omitted vs
nullin update records - Clear leveling - resetting
pausesandleveling_delay