Skip to main content

tasks

Creates, updates, deletes, gets or lists a tasks resource.

Overview

Nametasks
TypeResource
Idazure.ai_discovery.tasks

Fields

The following fields are returned by SELECT queries:

NameDatatypeDescription
namestringThe unique identifier of the task. Required.
assignedToobjectApplication or user assigned to this task.
commentsarrayComments or notes about the task.
createdAtstring (date-time)The timestamp when the resource was created.
createdBystringThe ID of the user who created this resource.
createdByTypestringType of entity that created the resource (User, Application, System, or custom type). Known values are: "User", "Application", and "System". (User, Application, System)
dependsOnarrayIDs of tasks that must complete before this task can be executed.
descriptionstringThe description of the task.
executionHistoryarrayHistory of execution events for this task.
investigationIdstringThe investigation identifier associated with the task.
lastModifiedAtstring (date-time)The timestamp when the resource was last updated.
lastModifiedBystringThe ID of the user who updated this resource.
lastModifiedByTypestringThe type of user who updated this resource. Known values are: "User", "Application", and "System". (User, Application, System)
parentIdstringID of the parent task if this is a subtask.
prioritystringThe priority of the task. Known values are: "Low", "Medium", and "High". (Low, Medium, High)
relatedToarrayIDs of tasks that are related to this task.
statusstringThe 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)
storageAssetIdsarrayList of storage assets related to the task.
taskResultobjectTask execution result with text and storage assets.
titlestringThe title of the task.
validationRequirementsarrayArray of validation requirements for the task.

Methods

The following methods are available for this resource:

NameAccessible byRequired ParamsOptional ParamsDescription
getselectproject_name, investigation_name, task_name, endpointGet a task by ID.
listselectproject_name, investigation_name, endpointfilterList tasks with optional OData filters.
createinsertproject_name, investigation_name, endpointCreate a new task.
updateupdateproject_name, investigation_name, task_name, endpointPatch (partial update) a task (e.g. status, description, validation requirements, dependencies, result).
deletedeleteproject_name, investigation_name, task_name, endpointDelete a task by ID.
startexecproject_name, investigation_name, task_name, endpointStart execution of a task.
add_commentexectask_name, project_name, investigation_name, endpoint, createdBy, createdByType, textAdd a comment to a task.
add_execution_historyexecproject_name, investigation_name, task_name, endpoint, createdAt, action, createdBy, createdByTypeAdd 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.

NameDatatypeDescription
endpointstringThe service endpoint host (no scheme), e.g. myaccount.table.cosmos.azure.com:443 - value of the client endpoint parameter. (default: )
investigation_namestringThe investigation name. Required.
project_namestringThe project name. Required.
task_namestringThe task name. Required.
filterstringOData 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 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
;

INSERT examples

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
;

UPDATE examples

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 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 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 }}"
}'
;