Slot#
One requirement instance on one task: the resources eligible to fill it and, once filled, the assignment that fills it. slots returns a Slot[] built from skills and requirements, and suggestAssignments takes a Slot[] in slots_json. A slot can also be written by hand, without the skill layer.
Fields#
| Field | Type | Required | Default | Description |
|---|---|---|---|---|
id |
Id |
yes | - | The slot's id, unique among the slots of a call. It's also the id of the assignment that fills the slot. It must not equal the id of any other existing assignment, active or inactive. |
task |
Id |
yes | - | The task the slot belongs to. Must be a scheduled leaf task. |
allowed |
Id[] |
yes | - | Resources eligible for the slot. The order is the tie-break preference: when two resources score the same, the earlier one wins. |
value |
number | null |
no | 1 |
Units of the assignment created when the slot is filled. Must be finite and greater than 0. Always present in slots output. |
assignment |
Id | null |
no | absent | The active assignment that fills the slot, on the same task. Absent or null means the slot is empty. Omitted from slots output when the slot is empty. |
Unknown fields are rejected with parse; see Wire format.
The slot's current resource is the resource of its assignment. suggestAssignments treats a slot as empty (no assignment), broken (the resource isn't in allowed) or valid (the resource is in allowed). What it does with each kind is covered in Suggesting assignments.
Since the slot id becomes the new assignment's id, pass it back as assignment on the next run so the slot counts as filled. slots binds it automatically.
Errors#
A missing id, task or allowed fails the call with parse and no path (see Required fields). suggestAssignments also fails with validation at these paths, checking slots in input order:
| Path | When |
|---|---|
slots[i].id |
Another slot has the same id, or the id is another existing assignment's id (other than the slot's own assignment). |
slots[i].task |
The task is unknown, unscheduled or a summary. |
slots[i].allowed[j] |
No resource has this id. |
slots[i].value |
value isn't finite or is 0 or less. |
slots[i].assignment |
The assignment is unknown, inactive, on another task, or bound by two slots. |
Used by#
slots- responsesuggestAssignments-slots_jsonrequest
Example#
An empty slot that either of two developers can fill at 50 %, and a filled slot bound to assignment be#1.
Related#
SuggestOptions-targetspicks empty, broken or valid slotsAssignmentData- the assignment that fills a slot- Suggesting assignments - filling, repairing and rebalancing slots
- Skills and requirements - building slots from skills