Skip to content

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

RelationKeyTypeRelation Field(s)
TaskTemplatetaskTemplateBelongs totask_template_id
DepartmentsdepartmentsBelongs to manyIntermediate table
UsersusersBelongs to manyIntermediate table
UsercreatorBelongs touser_id
TaskstasksHas manytask.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

KeyTypeDefaultDescription
title*string-The title of the assignment
descriptionstring-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_startinterval-When to show the tasks of this assignment.
activeboolean-Indicates if this assignment is active.
intervalrrule-How to repeat tasks from this assignment
interval_enddate-When to stop repeating tasks from this assignment
sort_numberinteger-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>-Tag
  • task_template_id - Has to be an existing TaskTemplate id
  • creator_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-DD
  • start_time - Format H:i:s
  • visibility_start - ISO 8601 DateInterval duration (example: P1M)
  • active - Will be set to true if empty
  • interval - iCalendar RFC5545 recurring rule (example: FREQ=DAILY;UNTIL=20171231T000000;BYDAY=MO,TU)
  • interval_end - Format YYYY-MM-DD
  • sort_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

KeyTypeDefaultDescription
titlestring-The title of the assignment
descriptionstring-The description of the assignment
task_template_idinteger-The id of the related TaskTemplate
creator_user_idinteger-UserID of the creator
assign_modestring-How to assign tasks to given departments/users
start_datedate-On which date this assignment starts
start_timedate-At which time this assignment starts.
visibility_startinterval-When to show the tasks of this assignment.
activeboolean-Indicates if this assignment is active.
intervalrrule-How to repeat tasks from this assignment
interval_enddate-When to stop repeating tasks from this assignment
sort_numberinteger-The sort number of this template.
department_idsarray-Departments that should get tasks from this assignment
user_idsarray-Users that should get tasks from this assignment

Advanced Key-Specifications

  • description - Has to be wrapped by a <p>-Tag
  • task_template_id - Has to be an existing TaskTemplate id
  • creator_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-DD
  • start_time - Format H:i:s
  • visibility_start - ISO 8601 DateInterval duration (example: P1M)
  • active - Will be set to true if empty
  • interval - iCalendar RFC5545 recurring rule (example: FREQ=DAILY;UNTIL=20171231T000000;BYDAY=MO,TU)
  • interval_end - Format YYYY-MM-DD
  • sort_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}.