tasks
Creates, updates, deletes, gets or lists a tasks resource.
Overview
| Name | tasks |
| Type | Resource |
| Id | azure.ai_discovery.tasks |
Fields
The following fields are returned by SELECT queries:
- get
- list
| Name | Datatype | Description |
|---|---|---|
name | string | The unique identifier of the task. Required. |
assignedTo | object | Application or user assigned to this task. |
comments | array | Comments or notes about the task. |
createdAt | string (date-time) | The timestamp when the resource was created. |
createdBy | string | The ID of the user who created this resource. |
createdByType | string | Type of entity that created the resource (User, Application, System, or custom type). Known values are: "User", "Application", and "System". (User, Application, System) |
dependsOn | array | IDs of tasks that must complete before this task can be executed. |
description | string | The description of the task. |
executionHistory | array | History of execution events for this task. |
investigationId | string | The investigation identifier associated with the task. |
lastModifiedAt | string (date-time) | The timestamp when the resource was last updated. |
lastModifiedBy | string | The ID of the user who updated this resource. |
lastModifiedByType | string | The type of user who updated this resource. Known values are: "User", "Application", and "System". (User, Application, System) |
parentId | string | ID of the parent task if this is a subtask. |
priority | string | The priority of the task. Known values are: "Low", "Medium", and "High". (Low, Medium, High) |
relatedTo | array | IDs of tasks that are related to this task. |
status | string | The current status of the task. Known values are: "New", "OnHold", "Complete", "Removed", "FlaggedHuman", "FlaggedAi", "Executing", "ExecutionDone", "Stale", "Failed", and "Incomplete". (New, OnHold, Complete, Removed, FlaggedHuman, FlaggedAi, Executing, ExecutionDone, Stale, Failed, Incomplete) |
storageAssetIds | array | List of storage assets related to the task. |
taskResult | object | Task execution result with text and storage assets. |
title | string | The title of the task. |
validationRequirements | array | Array of validation requirements for the task. |
| Name | Datatype | Description |
|---|---|---|
name | string | The unique identifier of the task. Required. |
assignedTo | object | Application or user assigned to this task. |
comments | array | Comments or notes about the task. |
createdAt | string (date-time) | The timestamp when the resource was created. |
createdBy | string | The ID of the user who created this resource. |
createdByType | string | Type of entity that created the resource (User, Application, System, or custom type). Known values are: "User", "Application", and "System". (User, Application, System) |
dependsOn | array | IDs of tasks that must complete before this task can be executed. |
description | string | The description of the task. |
executionHistory | array | History of execution events for this task. |
investigationId | string | The investigation identifier associated with the task. |
lastModifiedAt | string (date-time) | The timestamp when the resource was last updated. |
lastModifiedBy | string | The ID of the user who updated this resource. |
lastModifiedByType | string | The type of user who updated this resource. Known values are: "User", "Application", and "System". (User, Application, System) |
parentId | string | ID of the parent task if this is a subtask. |
priority | string | The priority of the task. Known values are: "Low", "Medium", and "High". (Low, Medium, High) |
relatedTo | array | IDs of tasks that are related to this task. |
status | string | The current status of the task. Known values are: "New", "OnHold", "Complete", "Removed", "FlaggedHuman", "FlaggedAi", "Executing", "ExecutionDone", "Stale", "Failed", and "Incomplete". (New, OnHold, Complete, Removed, FlaggedHuman, FlaggedAi, Executing, ExecutionDone, Stale, Failed, Incomplete) |
storageAssetIds | array | List of storage assets related to the task. |
taskResult | object | Task execution result with text and storage assets. |
title | string | The title of the task. |
validationRequirements | array | Array of validation requirements for the task. |
Methods
The following methods are available for this resource:
| Name | Accessible by | Required Params | Optional Params | Description |
|---|---|---|---|---|
get | select | project_name, investigation_name, task_name, endpoint | Get a task by ID. | |
list | select | project_name, investigation_name, endpoint | filter | List tasks with optional OData filters. |
create | insert | project_name, investigation_name, endpoint | Create a new task. | |
update | update | project_name, investigation_name, task_name, endpoint | Patch (partial update) a task (e.g. status, description, validation requirements, dependencies, result). | |
delete | delete | project_name, investigation_name, task_name, endpoint | Delete a task by ID. | |
start | exec | project_name, investigation_name, task_name, endpoint | Start execution of a task. | |
add_comment | exec | task_name, project_name, investigation_name, endpoint, createdBy, createdByType, text | Add a comment to a task. | |
add_execution_history | exec | project_name, investigation_name, task_name, endpoint, createdAt, action, createdBy, createdByType | Add an execution history entry to a task. |
Parameters
Parameters can be passed in the WHERE clause of a query. Check the Methods section to see which parameters are required or optional for each operation.
| Name | Datatype | Description |
|---|---|---|
endpoint | string | The service endpoint host (no scheme), e.g. myaccount.table.cosmos.azure.com:443 - value of the client endpoint parameter. (default: ) |
investigation_name | string | The investigation name. Required. |
project_name | string | The project name. Required. |
task_name | string | The task name. Required. |
filter | string | OData filter expression. Supported fields: investigationId, status, createdByType, priority, createdAt, lastModifiedAt. Example: status eq 'new' or status eq 'executing'. Default value is None. |
SELECT examples
- get
- list
Get a task by ID.
SELECT
name,
assignedTo,
comments,
createdAt,
createdBy,
createdByType,
dependsOn,
description,
executionHistory,
investigationId,
lastModifiedAt,
lastModifiedBy,
lastModifiedByType,
parentId,
priority,
relatedTo,
status,
storageAssetIds,
taskResult,
title,
validationRequirements
FROM azure.ai_discovery.tasks
WHERE project_name = '{{ project_name }}' -- required
AND investigation_name = '{{ investigation_name }}' -- required
AND task_name = '{{ task_name }}' -- required
AND endpoint = '{{ endpoint }}' -- required
;
List tasks with optional OData filters.
SELECT
name,
assignedTo,
comments,
createdAt,
createdBy,
createdByType,
dependsOn,
description,
executionHistory,
investigationId,
lastModifiedAt,
lastModifiedBy,
lastModifiedByType,
parentId,
priority,
relatedTo,
status,
storageAssetIds,
taskResult,
title,
validationRequirements
FROM azure.ai_discovery.tasks
WHERE project_name = '{{ project_name }}' -- required
AND investigation_name = '{{ investigation_name }}' -- required
AND endpoint = '{{ endpoint }}' -- required
AND filter = '{{ filter }}'
;
INSERT examples
- create
- Manifest
Create a new task.
INSERT INTO azure.ai_discovery.tasks (
title,
priority,
description,
validationRequirements,
parentId,
dependsOn,
relatedTo,
assignedTo,
comments,
status,
createdByType,
investigationId,
taskResult,
storageAssetIds,
project_name,
investigation_name,
endpoint
)
SELECT
'{{ title }}',
'{{ priority }}',
'{{ description }}',
'{{ validationRequirements }}',
'{{ parentId }}',
'{{ dependsOn }}',
'{{ relatedTo }}',
'{{ assignedTo }}',
'{{ comments }}',
'{{ status }}',
'{{ createdByType }}',
'{{ investigationId }}',
'{{ taskResult }}',
'{{ storageAssetIds }}',
'{{ project_name }}',
'{{ investigation_name }}',
'{{ endpoint }}'
RETURNING
name,
assignedTo,
comments,
createdAt,
createdBy,
createdByType,
dependsOn,
description,
executionHistory,
investigationId,
lastModifiedAt,
lastModifiedBy,
lastModifiedByType,
parentId,
priority,
relatedTo,
status,
storageAssetIds,
taskResult,
title,
validationRequirements
;
# Description fields are for documentation purposes
- name: tasks
props:
- name: project_name
value: "{{ project_name }}"
description: Required parameter for the tasks resource.
- name: investigation_name
value: "{{ investigation_name }}"
description: Required parameter for the tasks resource.
- name: endpoint
value: "{{ endpoint }}"
description: Required parameter for the tasks resource.
- name: title
value: "{{ title }}"
description: |
The title of the task.
- name: priority
value: "{{ priority }}"
description: |
The priority of the task. Known values are: "Low", "Medium", and "High".
valid_values: ['Low', 'Medium', 'High']
- name: description
value: "{{ description }}"
description: |
The description of the task.
- name: validationRequirements
value:
- "{{ validationRequirements }}"
description: |
Array of validation requirements for the task.
- name: parentId
value: "{{ parentId }}"
description: |
ID of the parent task if this is a subtask.
- name: dependsOn
value:
- "{{ dependsOn }}"
description: |
IDs of tasks that must complete before this task can be executed.
- name: relatedTo
value:
- "{{ relatedTo }}"
description: |
IDs of tasks that are related to this task.
- name: assignedTo
description: |
Application or user assigned to this task.
value:
id: "{{ id }}"
type: "{{ type }}"
- name: comments
description: |
Comments or notes about the task.
value:
- timestamp: "{{ timestamp }}"
createdBy: "{{ createdBy }}"
createdByType: "{{ createdByType }}"
text: "{{ text }}"
- name: status
value: "{{ status }}"
description: |
The current status of the task. Known values are: "New", "OnHold", "Complete", "Removed", "FlaggedHuman", "FlaggedAi", "Executing", "ExecutionDone", "Stale", "Failed", and "Incomplete".
valid_values: ['New', 'OnHold', 'Complete', 'Removed', 'FlaggedHuman', 'FlaggedAi', 'Executing', 'ExecutionDone', 'Stale', 'Failed', 'Incomplete']
- name: createdByType
value: "{{ createdByType }}"
description: |
Type of entity that created the resource (User, Application, System, or custom type). Known values are: "User", "Application", and "System".
valid_values: ['User', 'Application', 'System']
- name: investigationId
value: "{{ investigationId }}"
description: |
The investigation identifier associated with the task.
- name: taskResult
description: |
Task execution result with text and storage assets.
value:
text: "{{ text }}"
storageAssetIds:
- "{{ storageAssetIds }}"
- name: storageAssetIds
value:
- "{{ storageAssetIds }}"
description: |
List of storage assets related to the task.
UPDATE examples
- update
Patch (partial update) a task (e.g. status, description, validation requirements, dependencies, result).
UPDATE azure.ai_discovery.tasks
SET
title = '{{ title }}',
priority = '{{ priority }}',
description = '{{ description }}',
validationRequirements = '{{ validationRequirements }}',
parentId = '{{ parentId }}',
dependsOn = '{{ dependsOn }}',
relatedTo = '{{ relatedTo }}',
assignedTo = '{{ assignedTo }}',
comments = '{{ comments }}',
status = '{{ status }}',
createdByType = '{{ createdByType }}',
investigationId = '{{ investigationId }}',
taskResult = '{{ taskResult }}',
storageAssetIds = '{{ storageAssetIds }}'
WHERE
project_name = '{{ project_name }}' --required
AND investigation_name = '{{ investigation_name }}' --required
AND task_name = '{{ task_name }}' --required
AND endpoint = '{{ endpoint }}' --required
RETURNING
name,
assignedTo,
comments,
createdAt,
createdBy,
createdByType,
dependsOn,
description,
executionHistory,
investigationId,
lastModifiedAt,
lastModifiedBy,
lastModifiedByType,
parentId,
priority,
relatedTo,
status,
storageAssetIds,
taskResult,
title,
validationRequirements;
DELETE examples
- delete
Delete a task by ID.
DELETE FROM azure.ai_discovery.tasks
WHERE project_name = '{{ project_name }}' --required
AND investigation_name = '{{ investigation_name }}' --required
AND task_name = '{{ task_name }}' --required
AND endpoint = '{{ endpoint }}' --required
;
Lifecycle Methods
- start
- add_comment
- add_execution_history
Start execution of a task.
EXEC azure.ai_discovery.tasks.start
@project_name='{{ project_name }}' --required,
@investigation_name='{{ investigation_name }}' --required,
@task_name='{{ task_name }}' --required,
@endpoint='{{ endpoint }}' --required
@@json=
'{
"assignee": "{{ assignee }}"
}'
;
Add a comment to a task.
EXEC azure.ai_discovery.tasks.add_comment
@task_name='{{ task_name }}' --required,
@project_name='{{ project_name }}' --required,
@investigation_name='{{ investigation_name }}' --required,
@endpoint='{{ endpoint }}' --required
@@json=
'{
"timestamp": "{{ timestamp }}",
"createdBy": "{{ createdBy }}",
"createdByType": "{{ createdByType }}",
"text": "{{ text }}"
}'
;
Add an execution history entry to a task.
EXEC azure.ai_discovery.tasks.add_execution_history
@project_name='{{ project_name }}' --required,
@investigation_name='{{ investigation_name }}' --required,
@task_name='{{ task_name }}' --required,
@endpoint='{{ endpoint }}' --required
@@json=
'{
"createdAt": "{{ createdAt }}",
"action": "{{ action }}",
"createdBy": "{{ createdBy }}",
"createdByType": "{{ createdByType }}",
"summary": "{{ summary }}",
"responseMessageText": "{{ responseMessageText }}",
"responseMessageId": "{{ responseMessageId }}",
"additionalDetails": "{{ additionalDetails }}"
}'
;