Assign resources automatically
rillsoft_task_resource_assignment_fillBulk-assign employees or machines to tasks based on role requirements. Skips tasks with conflicts or closed balance and returns assignments made plus skipped causes.
Instructions
The 'Assign staff' respectively 'Assign machine park' wizard: fills many tasks at once out of their role assignments. One call is exactly one undo step, labelled like the menu entry. An assignment is made only where the task carries the matching role, the resource is not on it yet, it is not already involved through another role, and the balance of that role is still open. The result gives the assignments made per task plus skipped[] with the cause. Only at progress 0 %.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | No | automatic (the default) applies the rule behind the 'Select all' button (balance still open, no schedule conflict, and for people 100 % availability on top); selection takes only the pairs given in assignments | automatic |
| type | No | resource type; employee by default. Here resource covers exactly these two - an assistant works on concrete people and machines. The other four resource types (role, team, material, machine_role) are read and written through rillsoft_resource_usage_list and rillsoft_resource_usage_set | employee |
| taskUuids | No | UUIDs of the tasks; empty means every eligible task of the visible project or subproject, just like the menu entry | |
| assignments | No | only with mode selection: an array of { taskUuid, resourceId } | |
| resourceIds | No | preselection like the first wizard page; empty means every resource whose role the tasks call for |
Output Schema
| Name | Required | Description | Default |
|---|---|---|---|
| mode | Yes | operating mode chosen | |
| type | Yes | resource type | |
| tasks | Yes | the tasks that were changed | |
| skipped | Yes | skipped tasks with the cause | |
| assigned | Yes | number of assignments made |