1. API
  2. Cases
  3. Case templates

Preview

Description

Resolve a case template into the shape a case created from it would take, with tag, sub-status, assignee, and field references expanded into full objects. Formulas and field mentions are returned unevaluated, since there is no case to evaluate them against yet.

See the Get Cases API to learn more about cases.

Request

HTTP Method: GET

Path Parameter Description
id The case template ID.

Sample request

curl -X GET \
  https://<tenant-domain>/api/v1/case_templates/<<case_template_id>>/preview \
  -H 'content-type: application/json' \
  -H 'Authorization: Bearer <<CREDENTIAL.tines_api_key>>'

Response

A successful request will return a JSON object representing the case the template would create, or null when preview data cannot be generated for the template.

Field description

Parameter Description
name The case name.
description The case description.
status The case status - OPEN or CLOSED. Defaults to OPEN when the template does not set one.
priority The case priority - CRITICAL, HIGH, MEDIUM, LOW or INFO.
sub_status An object describing the case sub-status - ID and name.
assignees An array of users the case is assigned to.
tags An array of tags applied to the case - ID and name.
fields An array of case fields and the values they are pre-filled with.
actions An array of case actions for downstream actions associated with the case.
blocks An array of blocks laid out on the case.
tasks An array of tasks added to the case.
closure_conditions An array of closure requirements in the form of a set of formula rules that need to evaluate to true to enable the closing of a case.
metadata Case related metadata represented as key-value pairs.

Assignee object fields

Parameter Description
user_id The user ID.
email The user email.
first_name The user's first name.
last_name The user's last name.
avatar_url The user's avatar URL.

Field object fields

Parameter Description
value The value the field is pre-filled with.
case_input An object describing the field definition - id, key, name, validation_type (none, options or regex) and validation_options.

Action object fields

Parameter Description
action_type The action type - one of webhook, page, chat, story or app.
action_text The text shown on the action.
url The URL the action calls.
label The action tooltip.

Block object fields

Parameter Description
id The block GUID.
title The block title.
block_type The block type.
position The 1-based position of the block on the case.
hidden Boolean indicating whether the block is hidden.
block_group_id The GUID of the block group this block sits in.
elements An array of the elements the block contains - content, note_type (text or html), color and sensitive.

Task object fields

Parameter Description
description The task description.
assignees An array of users the task is assigned to - id, email, first_name and last_name.

Closure condition object fields

Parameter Description
name The closure requirement name.
formula The formula that must evaluate to true.

Sample response

{
  "name": "Phishing report for <<recipient>>",
  "description": "Investigate the reported email",
  "status": "OPEN",
  "priority": "MEDIUM",
  "sub_status": {
    "id": 88,
    "name": "Triage"
  },
  "assignees": [
    {
      "user_id": "2435",
      "email": "analyst@example.com",
      "first_name": "Ada",
      "last_name": "Lovelace",
      "avatar_url": null
    }
  ],
  "tags": [
    {
      "id": 17,
      "name": "phishing"
    }
  ],
  "fields": [
    {
      "value": "user@example.com",
      "case_input": {
        "id": 91,
        "key": "reporter_email",
        "name": "Reporter email",
        "validation_type": "none",
        "validation_options": null
      }
    }
  ],
  "actions": [
    {
      "action_type": "page",
      "action_text": "Open form",
      "url": "https://tenant.tines.com/pages/55e94b9b4e26175051c0287f4259363f/",
      "label": "Isolate host and give reason"
    }
  ],
  "blocks": [
    {
      "id": "block-1",
      "title": "Investigation notes",
      "block_type": "note",
      "position": 1,
      "hidden": false,
      "block_group_id": null,
      "elements": [
        {
          "content": "Initial triage required.",
          "note_type": "text",
          "color": "gold",
          "sensitive": null
        }
      ]
    }
  ],
  "tasks": [
    {
      "description": "Review headers and attachments",
      "assignees": [
        {
          "id": "2435",
          "email": "analyst@example.com",
          "first_name": "Ada",
          "last_name": "Lovelace"
        }
      ]
    }
  ],
  "closure_conditions": [
    {
      "name": "has at least 1 assignee",
      "formula": "=SIZE(team_case.assignees) > 0"
    }
  ],
  "metadata": {
    "source": "user_report"
  }
}
Was this helpful?