Skip to content

TaskTemplates

Introduction

TaskTemplates are the component where all information about what the task is and how it should be reported is stored.

Usually it will have related FormFields which describe how TaskProgressFields should be filled by the executing user. TaskTemplates can have other TaskTemplates as children.

TaskAssignments will utilize the TaskTemplate information to create Tasks assigned to users or user groups.

Model & Relations

Namespace

Modules\Tasks\Entities\TaskTemplate

Relations

RelationKeyTypeRelation Field(s)
TaskTemplateparentBelongs toparent_id
TaskTemplateschildrenHas manyparent_id
TaskAssignmentstaskAssignmentsHas manyparent_id
TaskstasksHas many throughtasks.task_assignment_id
FormFieldsformFieldsHas manyform_fields.form_id form_fields.type
UseruserBelongs touser_id
LayoutslayoutsHas manylayouts.layoutable_type, layouts.layoutable_id

Traits

  • Sortable
  • Layoutable

List

To get a list of task template, create a GET request to:

/api/administration/tasks-2/templates/.

Example Request

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

Example Response

json
[
    {
        "id": 6,
        "title": "Template-1",
        "description": "<p>Describe your template</p>",
        "parent_id": null,
        "revision_id": null,
        "origin_id": null,
        "folder_id": null,
        "sort_number": 39,
        "user_id": 144,
        "created_at": "2019-09-20 11:47:09",
        "updated_at": "2019-09-21 09:57:09",
        "deleted_at": null,
        "grade_scale": null,
        "tour_enabled": true
    },
    {
        "id": 7,
        "title": "SubTemplate-1",
        "description": "<p>Describe your template</p>",
        "parent_id": 6,
        "revision_id": null,
        "origin_id": null,
        "folder_id": null,
        "sort_number": 1,
        "user_id": 2,
        "created_at": "2019-09-20 11:47:09",
        "updated_at": "2019-09-20 11:47:09",
        "deleted_at": null,
        "grade_scale": null,
        "tour_enabled": false
    }

Get

To get a task template, create a GET request to:

/api/administration/tasks-2/templates/{id}.

Example Request

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

Example Response

json
{
  "id": 6,
  "title": "Template-1",
  "description": "<p>Describe your Template</p>",
  "parent_id": null,
  "revision_id": null,
  "origin_id": null,
  "folder_id": null,
  "sort_number": 39,
  "user_id": 144,
  "created_at": "2019-09-20 11:47:09",
  "updated_at": "2019-09-21 09:57:09",
  "deleted_at": null,
  "grade_scale": null,
  "tour_enabled": true
}

Create

To create a new task template, create a POST request to:

/api/tasks-2/templates/.

Request Keys

KeyTypeDefaultDescription
title*string-The title of the template
descriptionstring-The description of the template
parent_idinteger-The parent_id
sort_numberinteger-The sort number of this template.
grade_scaleinteger-The grade scale of this template
tour_enabledboolean-Enables a user tour for tasks of this template

Keys with * are required.

Advanced Key-Specifications

  • 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.
  • parent_id - Has to be an existing task template id.

Delete

To delete a Post, create a DELETE request to:

/api/administration/tasks-2/templates/{id}.

Update

To update a task template, create a PUT request to:

/api/administration/tasks-2/templates/{id}.

Request Keys

KeyTypeDefaultDescription
titlestring-The title of the template
descriptionstring-The description of the template
parent_idinteger-The parent_id
sort_numberinteger-The sort number of this template.
grade_scaleinteger-The grade scale of this template
tour_enabledboolean-Enables a user tour for tasks of this template

Keys with * are required.

Advanced Key-Specifications

  • 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.
  • parent_id - Has to be an existing task template id.