TaskExecutions
Last updated
Last updated
TaskExecutions represent a specific task a user or user group should execute. When creating a with recurr configuration, the tasks will be created automatically.
All information which is reported for an execution such as or information will be attached to a .
There will never be the need to create a task directly as it is always a result of configuration and information.
Tasks are always subject of . Thus given, you're API user may not be able to alter every task's information.
Alias
taskExecution
Relations
taskProgressFields
Has many
task_progress_fields.task_id
taskAssignment
Belongs to
task_assignment_id
taskTemplate
Belongs to
task_template_id
TaskStatus
taskStatus
hasOne
tasks_status_id
lastActivityUser
Belongs to
last_activity_user_id
parent
Belongs to
parent_id
children
Has many
parent_id
Computed Properties
Traits
Sortable
A task can have the following states:
open
in_progress
in_progress_delayed
done
done_delayed
denied
missed
All _delayed states are determined by the api itself based on the calculated execution date.
To get a list of TaskExecutions in a DateRange, create a GET request to:
/api/tasks-2/executions?period_start={StartDate}&period_end={EndDate}
.
Example Request
Example Response
To get a count of all tasks for the current user, create a GET request to:
/api/tasks-2/executions/count
.
To show a TaskExecution, create a GET request to:
/api/tasks-2/executions/{id}
.
Example Request
Example Response
Create a new TaskExecution
.
Definition
POST
/api/tasks-2/executions
Request Keys
task_assignment_id
*
integer
-
task_template_id
*
integer
-
parent_id
integer
-
The ID of the parent TaskExecution
when creating a child TaskExecution
task_status_id
string
open
The initial status for the TaskExecution
.
for_execution_date
datetime
-
The execution date of the TaskExecution
.
Keys with *
are required.
Example Request
Example Response
/api/tasks-2/executions/{id}/progress/
The request must have a JSON body with the following keys:
{field-key}
*
{fieldType}
-
Valid FieldKey defined on TaskTemplate
{field-key_additional_information}
string
-
Additional information text for field key.
Keys with *
are required.
field-key_additional_information
- You can pass additional_information for every TaskProgressField. Just suffix the field-key with _additional_information
/api/tasks-2/executions/{id}/progress/finish
The request must have a JSON body with the following keys:
{field-key}
*
{fieldType}
-
Valid FieldKey defined on TaskTemplate
delayed_reason
*
string
-
Delayed reason as text.
Keys with *
are required.
This will set the task status to denied
.
To deny a task, create a PUT request to:
/api/tasks-2/executions/{id}/deny/
The request must have a JSON body with the following keys:
deny_reason
*
string
-
Reason for denying the task.
Keys with *
are required.
Removes all attached information from given task and resets the status to in_progress
.
To reset a task, create a POST request to:
/api/tasks-2/executions/{id}/reset/
To update the state of a task, create a PUT request to:
/api/tasks-2/executions/{id}/status/
The request must have a JSON body with the following keys:
task_status_id
*
string
-
The TaskStatus that should be set.
Keys with *
are required.
task_status_id
- Has to be a valid `task status identifier.
If the task has a _delayed state, you must not set a status without _delayed suffix.
achieved_points
- Calculated achieved points from .
max_points
- Calculated maximum achievable points from .
The "done" state is, with one exception, only granted by the finish route
if all necessary were passed.
If there are no defined for the tasks , the "done" status can be granted through update-status route
, too.
The ID of the to create the TaskExecution
for.
The ID of the to use for the TaskExecution
.
Will save all information passed according to the configured of the related without applying any validation rules. When a FormField value is passed, there will be an according created which holds information about the passed value. This is meant to be called when a user fills a for a but is not finishing the execution yet.
To update the progress fields of a , create a PUT request to:
field-key
- This represents the field to save a value for. Has to be a valid key
of a related to the Tasks . The type is determined from definition. You can pass many fields and values at once.
The will be automatically set to in_progress
or in_progress_delayed
, respecting the time the request is received.
Will save all information passed for while applying all related . If validation doesn't fail, the information will be saved as and the task will be marked as finished.
To update the progress fields of a and finish it, create a PUT request to:
field-key
- This represents the field to save a value for. Has to be a valid key
of a related to the Tasks . The type and validation is determined from definition. Thus given, all required have to be passed to finish a Task.
field-key_additional_information
- You can pass additional_information for every . Just suffix the field-key with _additional_information
delayed_reason
- Required if the is in_progress_delayed
You can only set the status "done" if there are no open child tasks and there are no defined for the Tasks