API Docs
HomeDocsWebsite
  • Home
  • Introduction
    • Authorization
      • Authorize
      • Get a Token
      • Third-Party Login
    • Field Types and Validation
      • Field Types
      • Validation
    • Query Manipulation
      • Constraints
      • Result Control
      • Value Filters
    • Entity Permissions
      • Restricted Scope
  • API reference
    • Infoboard
      • InfoboardChannels
      • InfoboardPosts
      • InfoboardPostSeenUsers
      • InfoboardPostReadUsers
      • InfoboardComments
      • InfoboardDepartmentSettings
    • Manual
      • ManualChapters
      • ManualEntries
      • ManualEntrySeenUsers
    • Calendar
      • Calendars
      • CalendarEvents
    • Filemanager
      • FilemanagerDirectories
      • FilemanagerFiles
    • Files
    • Forms
      • Forms
      • FormFields
      • FormFieldTypes
      • FormFieldValidations
      • FormFieldValidationTypes
      • FormMessages
      • FormMessageFields
    • Layouts
      • Layouts
      • LayoutRows
      • LayoutColumns
      • LayoutColumnLayoutElements
    • Tasks 2.0
      • TaskTemplates
      • TaskFields
      • TaskAssignments
      • TaskExecutions
      • TaskProgressFields
    • Departments
    • Roles
    • Permissions
    • Users
    • EntityPermissions
    • Notifications
    • Reactions
    • Icons
    • Folders
    • SharedItems
    • UrlContext
  • Resources
    • Release Notes
      • v2.106.0
      • v2.102.0
Powered by GitBook
On this page
  • Introduction
  • Model Definition
  • Task status indicators
  • List by DateRange
  • Count
  • Show
  • Create
  • Progress
  • Finish
  • Deny
  • Reset
  • Update state
  1. API reference
  2. Tasks 2.0

TaskExecutions

PreviousTaskAssignmentsNextTaskProgressFields

Last updated 6 months ago

Introduction

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.

Model Definition

Alias

taskExecution

Relations

Relation
Key
Type
Relation Field(s)

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

Task status indicators

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.

List by DateRange

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

$client = new GuzzleHttp\Client(['base_uri' => 'https://{tenant}.intratool.de']);
$response = $client->request('GET', '/api/tasks-2/executions?period_start=2021-02-16+00:00:00&period_end=2021-02-16+23:59:59', [
    'headers' => ['Authorization' => "Bearer {accessToken}"]
]);

Example Response

[
    {
        "id": 155,
        "user_id": 144,
        "department_id": null,
        "last_activity_user_id": 144,
        "parent_id": null,
        "task_assignment_id": 80,
        "task_template_id": 31,
        "task_status_id": "done",
        "for_execution_date": null,
        "started_at": "2020-07-16 14:44:05",
        "ended_at": "2020-07-16 14:44:05",
        "deny_reason": null,
        "delayed_reason": null,
        "created_at": "2020-07-16 14:44:03",
        "updated_at": "2020-07-16 14:44:05",
        "deleted_at": null,
        "hash": "eyJ1aWQiOjE0NCwiZGlkIjpudWxsLCJ0YWlkIjo4MCwidHRpZCI6MzEsImZlZCI6bnVsbH0=",
        "execution_start_time": null,
        "execution_end_time": null,
        "visibility_start_time": null,
        "achieved_points": 0,
        "max_points": 0,
        "children": [],
        "task_assignment": {
            "id": 80,
            "parent_id": null,
            "inherit_parent_values": false,
            "revision_id": null,
            "origin_id": null,
            "folder_id": null,
            "title": "TaskAssignment-1",
            "description": null,
            "task_template_id": 31,
            "task_template_composition_id": null,
            "creator_user_id": 144,
            "assign_mode": "one_of",
            "priority": null,
            "start_date": null,
            "start_time": null,
            "show_before_interval": null,
            "executable_before_interval": null,
            "executable_after_interval": null,
            "interval": null,
            "interval_end": null,
            "earliest_visibility_date": "2020-07-16 14:43:10",
            "latest_execution_date": null,
            "user_confirmation_required": true,
            "dispatched_by_system": 0,
            "dispatchable_id": null,
            "dispatchable_type": null,
            "trigger_id": null,
            "active": true,
            "always_executable": false,
            "sort_number": 55,
            "created_at": "2020-07-16 14:43:10",
            "updated_at": "2021-01-01 02:15:35",
            "deleted_at": null
        },
        "task_progress_fields": [],
        "task_template": {
            "id": 31,
            "title": "Template-1",
            "description": null,
            "parent_id": null,
            "revision_id": null,
            "origin_id": null,
            "folder_id": null,
            "sort_number": 38,
            "user_id": 144,
            "created_at": "2020-07-16 14:43:08",
            "updated_at": "2020-07-16 14:43:08",
            "deleted_at": null,
            "grade_scale": null,
            "tour_enabled": true,
            "form_fields": []
        }
    },
    ...
]

Count

To get a count of all tasks for the current user, create a GET request to:

/api/tasks-2/executions/count.

Show

To show a TaskExecution, create a GET request to:

/api/tasks-2/executions/{id}.

Example Request

$client = new GuzzleHttp\Client(['base_uri' => 'https://{tenant}.intratool.de']);
$response = $client->request('GET', '/api/tasks-2/executions/{id}', [
    'headers' => ['Authorization' => "Bearer {accessToken}"]
]);

Example Response

{
  "id": 155,
  "user_id": 144,
  "department_id": null,
  "last_activity_user_id": 144,
  "parent_id": null,
  "task_assignment_id": 80,
  "task_template_id": 31,
  "task_status_id": "done",
  "for_execution_date": null,
  "started_at": "2020-07-16 14:44:05",
  "ended_at": "2020-07-16 14:44:05",
  "deny_reason": null,
  "delayed_reason": null,
  "created_at": "2020-07-16 14:44:03",
  "updated_at": "2020-07-16 14:44:05",
  "deleted_at": null,
  "hash": "eyJ1aWQiOjE0NCwiZGlkIjpudWxsLCJ0YWlkIjo4MCwidHRpZCI6MzEsImZlZCI6bnVsbH0=",
  "execution_start_time": null,
  "execution_end_time": null,
  "visibility_start_time": null,
  "achieved_points": 0,
  "max_points": 0,
  "children": [],
  "task_assignment": {
    "id": 80,
    "parent_id": null,
    "inherit_parent_values": false,
    "revision_id": null,
    "origin_id": null,
    "folder_id": null,
    "title": "TaskAssignment-1",
    "description": null,
    "task_template_id": 31,
    "task_template_composition_id": null,
    "creator_user_id": 144,
    "assign_mode": "one_of",
    "priority": null,
    "start_date": null,
    "start_time": null,
    "show_before_interval": null,
    "executable_before_interval": null,
    "executable_after_interval": null,
    "interval": null,
    "interval_end": null,
    "earliest_visibility_date": "2020-07-16 14:43:10",
    "latest_execution_date": null,
    "user_confirmation_required": true,
    "dispatched_by_system": 0,
    "dispatchable_id": null,
    "dispatchable_type": null,
    "trigger_id": null,
    "active": true,
    "always_executable": false,
    "sort_number": 55,
    "created_at": "2020-07-16 14:43:10",
    "updated_at": "2021-01-01 02:15:35",
    "deleted_at": null
  },
  "task_progress_fields": [],
  "task_template": {
    "id": 31,
    "title": "Template-1",
    "description": null,
    "parent_id": null,
    "revision_id": null,
    "origin_id": null,
    "folder_id": null,
    "sort_number": 38,
    "user_id": 144,
    "created_at": "2020-07-16 14:43:08",
    "updated_at": "2020-07-16 14:43:08",
    "deleted_at": null,
    "grade_scale": null,
    "tour_enabled": true,
    "form_fields": []
  }
}

Create

Create a new TaskExecution.

Definition

POST /api/tasks-2/executions

Request Keys

Key
Type
Default
Description

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

$client = new GuzzleHttp\Client(['base_uri' => 'https://{tenant}.intratool.de']);
$response = $client->request('POST', '/api/tasks-2/executions', [
    'headers' => ['Authorization' => "Bearer {accessToken}"],
    'json' => [
        'task_assignment_id' => 1,
        'task_template_id' => 1
    ]
]);

Example Response

{
  "status": "success",
  "data": {
    "task_assignment_id": 1,
    "task_template_id": 1,
    "task_template_id": "open",
    "user_id": 1,
    "department_id": 1,
    "last_activity_user_id": null,
    "started_at": null,
    "ended_at": null,
    "updated_at": "2024-10-01 12:00:00",
    "created_at": "2024-10-01 12:00:00",
    "id": 1,
    "hash": "eyJ0ZWlkIjo1OTQyLCJ1aWQiOjQwLCJkaWQiOjksInBpZCI6bnVsbCwidGFpZCI6NTU4LCJ0dGlkIjoyMDMsImZlZCI6bnVsbH0="
  }
}

Progress

/api/tasks-2/executions/{id}/progress/

The request must have a JSON body with the following keys:

Key
Type
Default
Description

{field-key}*

{fieldType}

-

Valid FieldKey defined on TaskTemplate

{field-key_additional_information}

string

-

Additional information text for field key.

Keys with * are required.

Advanced Key-Specifications

  • field-key_additional_information - You can pass additional_information for every TaskProgressField. Just suffix the field-key with _additional_information

Finish

/api/tasks-2/executions/{id}/progress/finish

The request must have a JSON body with the following keys:

Key
Type
Default
Description

{field-key}*

{fieldType}

-

Valid FieldKey defined on TaskTemplate

delayed_reason*

string

-

Delayed reason as text.

Keys with * are required.

Advanced Key-Specifications

Deny

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:

Key
Type
Default
Description

deny_reason*

string

-

Reason for denying the task.

Keys with * are required.

Reset

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/

Update state

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:

Key
Type
Default
Description

task_status_id*

string

-

The TaskStatus that should be set.

Keys with * are required.

Advanced Key-Specifications

  • 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

TaskProgressFields
TaskProgressFields
Restrictable
FormFields
FormFields
TaskTemplate
FormFields
TaskTemplate
TaskProgressField
FormField
Task
Task
FormField
TaskTemplate
FormField
FormFields
FormFieldValidations
TaskProgressFields
Task
FormField
TaskTemplate
FormField
FormFields
TaskProgressField
FormFields
TaskTemplate
TaskAssignment
TaskProgressField
Task
TaskAssignments
TaskTemplate
entity based permissions
TaskProgressStates
TaskStatus
TaskStatus
TaskProgressFields
TaskAssignment
TaskTemplate
User
Task
Tasks
TaskAssignment
TaskTemplate