Appearance
TaskAssignments
Introduction
TaskAssignments
describe when a task should be executed by users or user groups.
The information passed for TaskAssignments
and related TaskTemplates will be used to create Tasks for each user and group automatically.
Model & Relations
Namespace
Modules\Tasks\Entities\TaskAssignment
Relations
Relation | Key | Type | Relation Field(s) |
---|---|---|---|
TaskTemplate | taskTemplate | Belongs to | task_template_id |
Departments | departments | Belongs to many | Intermediate table |
Users | users | Belongs to many | Intermediate table |
User | creator | Belongs to | user_id |
Tasks | tasks | Has many | task.task_assignment_id |
Traits
Sortable
List
To get a list of TaskAssignment, create a GET request to:
/api/tasks-2/task-assignments/
.
Get
To get a TaskAssignments, create a GET request to:
/api/tasks-2/task-assignments/{id}
.
Create
To create a new TaskAssignment, create a POST request to:
/api/tasks-2/task-assignments/
.
Request Keys
Key | Type | Default | Description |
---|---|---|---|
title * | string | - | The title of the assignment |
description | string | - | The description of the assignment |
task_template_id * | integer | - | The id of the related TaskTemplate |
creator_user_id * | integer | - | UserID of the creator |
assign_mode * | string | - | How to assign tasks to given departments/users |
start_date * | date | - | On which date this assignment starts |
start_time * | date | - | At which time this assignment starts. |
visibility_start | interval | - | When to show the tasks of this assignment. |
active | boolean | - | Indicates if this assignment is active. |
interval | rrule | - | How to repeat tasks from this assignment |
interval_end | date | - | When to stop repeating tasks from this assignment |
sort_number | integer | - | The sort number of this template. |
department_ids * | array | - | Departments that should get tasks from this assignment |
user_ids * | array | - | Users that should get tasks from this assignment |
Keys with *
are required.
Advanced Key-Specifications
description
- Has to be wrapped by a<p>
-Tagtask_template_id
- Has to be an existing TaskTemplate idcreator_user_id
- Has to be an existing user id. Will be set to current user if empty.assign_mode
- Has to be one of the following identifiers:- one_of
- any_of
- one_of_user
- any_of_user
start_date
- Format YYYY-MM-DDstart_time
- Format H:i:svisibility_start
- ISO 8601 DateInterval duration (example: P1M)active
- Will be set totrue
if emptyinterval
- iCalendar RFC5545 recurring rule (example: FREQ=DAILY;UNTIL=20171231T000000;BYDAY=MO,TU)interval_end
- Format YYYY-MM-DDsort_number
- The input will be set to the maximum number, if left empty.sort_number
- If you pass a number in between existing sorted entries, other entries will be automatically updated.department_ids
- Only required if no user_ids are given. Have to be existing department ids.user_ids
- Only required if no department_ids are given. Have to be existing user ids.
Note
When saving a TaskAssignment
, there will be resulting Tasks and EntityPermissions created.
Update
To update a new TaskAssignment, create a PUT request to:
/api/tasks-2/task-assignments/
.
Request Keys
Key | Type | Default | Description |
---|---|---|---|
title | string | - | The title of the assignment |
description | string | - | The description of the assignment |
task_template_id | integer | - | The id of the related TaskTemplate |
creator_user_id | integer | - | UserID of the creator |
assign_mode | string | - | How to assign tasks to given departments/users |
start_date | date | - | On which date this assignment starts |
start_time | date | - | At which time this assignment starts. |
visibility_start | interval | - | When to show the tasks of this assignment. |
active | boolean | - | Indicates if this assignment is active. |
interval | rrule | - | How to repeat tasks from this assignment |
interval_end | date | - | When to stop repeating tasks from this assignment |
sort_number | integer | - | The sort number of this template. |
department_ids | array | - | Departments that should get tasks from this assignment |
user_ids | array | - | Users that should get tasks from this assignment |
Advanced Key-Specifications
description
- Has to be wrapped by a<p>
-Tagtask_template_id
- Has to be an existing TaskTemplate idcreator_user_id
- Has to be an existing user id. Will be set to current user if empty.assign_mode
- Has to be one of the following identifiers:- one_of
- any_of
- one_of_user
- any_of_user
start_date
- Format YYYY-MM-DDstart_time
- Format H:i:svisibility_start
- ISO 8601 DateInterval duration (example: P1M)active
- Will be set totrue
if emptyinterval
- iCalendar RFC5545 recurring rule (example: FREQ=DAILY;UNTIL=20171231T000000;BYDAY=MO,TU)interval_end
- Format YYYY-MM-DDsort_number
- The input will be set to the maximum number, if left empty.sort_number
- If you pass a number in between existing sorted entries, other entries will be automatically updated.department_ids
- Only required if no user_ids are given. Have to be existing department ids.user_ids
- Only required if no department_ids are given. Have to be existing user ids.
Delete
To delete a TaskAssignment, create a DELETE request to:
/api/tasks-2/task-assignments/{id}
.