BackstageClient.tasks
BackstageClient.tasks in @ticketlayer/backstage.
@ticketlayer/backstage / BackstageClient / tasks
tasks: {
claim: (taskId: string, requestOptions?: RequestOptions) => Promise<{
accountId: string | null;
actions: {
action: string;
closesAs: "done" | "dismissed";
label: string;
requiresNotes: boolean;
}[];
assignee: | {
id: string;
type: "user" | "role" | "account";
}
| null;
availableActions: string[];
claimedAt: string | null;
createdAt: string;
createdBy: string | null;
description: string | null;
details: {
[key: string]: unknown;
};
dueAt: string | null;
id: string;
isTest: boolean;
organisationId: string;
outcome: string | null;
outcomeNotes: string | null;
overdue: boolean;
priority: "low" | "normal" | "high" | "urgent";
queueId: string | null;
resolvedAt: string | null;
resolvedBy: string | null;
resolverKind: "user" | "workflow" | "system" | "app" | null;
source: {
id: string | null;
kind: "user" | "workflow" | "system" | "app";
};
status: "expired" | "open" | "done" | "claimed" | "dismissed";
subject: | {
id: string;
type: string;
}
| null;
title: string;
type: string;
updatedAt: string;
}>;
counts: (requestOptions?: RequestOptions) => Promise<{
assignedToMe: number;
mine: number;
overdue: number;
queues: {
claimed: number;
name: string;
open: number;
overdue: number;
queueId: string;
}[];
unassigned: number;
}>;
create: (request: {
accountId?: string | null;
assignee?: | {
userId: string;
}
| {
roleId: string;
}
| {
accountId: string;
}
| {
queueId: string;
}
| null;
description?: string | null;
details?: {
[key: string]: unknown;
};
dueAt?: string | null;
priority?: "low" | "normal" | "high" | "urgent";
subjectId?: string | null;
title: string;
type: string;
}, requestOptions?: RequestOptions) => Promise<{
accountId: string | null;
actions: {
action: string;
closesAs: "done" | "dismissed";
label: string;
requiresNotes: boolean;
}[];
assignee: | {
id: string;
type: "user" | "role" | "account";
}
| null;
availableActions: string[];
claimedAt: string | null;
createdAt: string;
createdBy: string | null;
description: string | null;
details: {
[key: string]: unknown;
};
dueAt: string | null;
id: string;
isTest: boolean;
organisationId: string;
outcome: string | null;
outcomeNotes: string | null;
overdue: boolean;
priority: "low" | "normal" | "high" | "urgent";
queueId: string | null;
resolvedAt: string | null;
resolvedBy: string | null;
resolverKind: "user" | "workflow" | "system" | "app" | null;
source: {
id: string | null;
kind: "user" | "workflow" | "system" | "app";
};
status: "expired" | "open" | "done" | "claimed" | "dismissed";
subject: | {
id: string;
type: string;
}
| null;
title: string;
type: string;
updatedAt: string;
}>;
decide: (taskId: string, request: {
action: string;
notes?: string | null;
}, requestOptions?: RequestOptions) => Promise<{
accountId: string | null;
actions: {
action: string;
closesAs: "done" | "dismissed";
label: string;
requiresNotes: boolean;
}[];
assignee: | {
id: string;
type: "user" | "role" | "account";
}
| null;
availableActions: string[];
claimedAt: string | null;
createdAt: string;
createdBy: string | null;
description: string | null;
details: {
[key: string]: unknown;
};
dueAt: string | null;
id: string;
isTest: boolean;
organisationId: string;
outcome: string | null;
outcomeNotes: string | null;
overdue: boolean;
priority: "low" | "normal" | "high" | "urgent";
queueId: string | null;
resolvedAt: string | null;
resolvedBy: string | null;
resolverKind: "user" | "workflow" | "system" | "app" | null;
source: {
id: string | null;
kind: "user" | "workflow" | "system" | "app";
};
status: "expired" | "open" | "done" | "claimed" | "dismissed";
subject: | {
id: string;
type: string;
}
| null;
title: string;
type: string;
updatedAt: string;
}>;
get: (taskId: string, requestOptions?: RequestOptions) => Promise<{
accountId: string | null;
actions: {
action: string;
closesAs: "done" | "dismissed";
label: string;
requiresNotes: boolean;
}[];
assignee: | {
id: string;
type: "user" | "role" | "account";
}
| null;
availableActions: string[];
claimedAt: string | null;
createdAt: string;
createdBy: string | null;
description: string | null;
details: {
[key: string]: unknown;
};
dueAt: string | null;
id: string;
isTest: boolean;
organisationId: string;
outcome: string | null;
outcomeNotes: string | null;
overdue: boolean;
priority: "low" | "normal" | "high" | "urgent";
queueId: string | null;
resolvedAt: string | null;
resolvedBy: string | null;
resolverKind: "user" | "workflow" | "system" | "app" | null;
source: {
id: string | null;
kind: "user" | "workflow" | "system" | "app";
};
status: "expired" | "open" | "done" | "claimed" | "dismissed";
subject: | {
id: string;
type: string;
}
| null;
title: string;
type: string;
updatedAt: string;
}>;
list: (options?: {
accountId?: string;
cursor?: string;
inbox?: "all" | "unassigned" | "mine";
limit?: number;
mode?: "live" | "test" | "all";
overdue?: "true" | "false";
priority?: "low" | "normal" | "high" | "urgent";
queueId?: string;
status?: "expired" | "open" | "done" | "claimed" | "dismissed" | "active";
subjectId?: string;
type?: string;
}, requestOptions?: RequestOptions) => Promise<{
nextCursor: string | null;
tasks: {
accountId: string | null;
actions: {
action: string;
closesAs: "done" | "dismissed";
label: string;
requiresNotes: boolean;
}[];
assignee: | {
id: string;
type: "user" | "role" | "account";
}
| null;
availableActions: string[];
claimedAt: string | null;
createdAt: string;
createdBy: string | null;
description: string | null;
details: {
[key: string]: unknown;
};
dueAt: string | null;
id: string;
isTest: boolean;
organisationId: string;
outcome: string | null;
outcomeNotes: string | null;
overdue: boolean;
priority: "low" | "normal" | "high" | "urgent";
queueId: string | null;
resolvedAt: string | null;
resolvedBy: string | null;
resolverKind: "user" | "workflow" | "system" | "app" | null;
source: {
id: string | null;
kind: "user" | "workflow" | "system" | "app";
};
status: "expired" | "open" | "done" | "claimed" | "dismissed";
subject: | {
id: string;
type: string;
}
| null;
title: string;
type: string;
updatedAt: string;
}[];
}>;
reassign: (taskId: string, request:
| {
userId: string;
}
| {
roleId: string;
}
| {
accountId: string;
}
| {
queueId: string;
}, requestOptions?: RequestOptions) => Promise<{
accountId: string | null;
actions: {
action: string;
closesAs: "done" | "dismissed";
label: string;
requiresNotes: boolean;
}[];
assignee: | {
id: string;
type: "user" | "role" | "account";
}
| null;
availableActions: string[];
claimedAt: string | null;
createdAt: string;
createdBy: string | null;
description: string | null;
details: {
[key: string]: unknown;
};
dueAt: string | null;
id: string;
isTest: boolean;
organisationId: string;
outcome: string | null;
outcomeNotes: string | null;
overdue: boolean;
priority: "low" | "normal" | "high" | "urgent";
queueId: string | null;
resolvedAt: string | null;
resolvedBy: string | null;
resolverKind: "user" | "workflow" | "system" | "app" | null;
source: {
id: string | null;
kind: "user" | "workflow" | "system" | "app";
};
status: "expired" | "open" | "done" | "claimed" | "dismissed";
subject: | {
id: string;
type: string;
}
| null;
title: string;
type: string;
updatedAt: string;
}>;
release: (taskId: string, requestOptions?: RequestOptions) => Promise<{
accountId: string | null;
actions: {
action: string;
closesAs: "done" | "dismissed";
label: string;
requiresNotes: boolean;
}[];
assignee: | {
id: string;
type: "user" | "role" | "account";
}
| null;
availableActions: string[];
claimedAt: string | null;
createdAt: string;
createdBy: string | null;
description: string | null;
details: {
[key: string]: unknown;
};
dueAt: string | null;
id: string;
isTest: boolean;
organisationId: string;
outcome: string | null;
outcomeNotes: string | null;
overdue: boolean;
priority: "low" | "normal" | "high" | "urgent";
queueId: string | null;
resolvedAt: string | null;
resolvedBy: string | null;
resolverKind: "user" | "workflow" | "system" | "app" | null;
source: {
id: string | null;
kind: "user" | "workflow" | "system" | "app";
};
status: "expired" | "open" | "done" | "claimed" | "dismissed";
subject: | {
id: string;
type: string;
}
| null;
title: string;
type: string;
updatedAt: string;
}>;
};Defined in: client.ts:11379
Tasks methods
claim()#
claim: (taskId: string, requestOptions?: RequestOptions) => Promise<{
accountId: string | null;
actions: {
action: string;
closesAs: "done" | "dismissed";
label: string;
requiresNotes: boolean;
}[];
assignee: | {
id: string;
type: "user" | "role" | "account";
}
| null;
availableActions: string[];
claimedAt: string | null;
createdAt: string;
createdBy: string | null;
description: string | null;
details: {
[key: string]: unknown;
};
dueAt: string | null;
id: string;
isTest: boolean;
organisationId: string;
outcome: string | null;
outcomeNotes: string | null;
overdue: boolean;
priority: "low" | "normal" | "high" | "urgent";
queueId: string | null;
resolvedAt: string | null;
resolvedBy: string | null;
resolverKind: "user" | "workflow" | "system" | "app" | null;
source: {
id: string | null;
kind: "user" | "workflow" | "system" | "app";
};
status: "expired" | "open" | "done" | "claimed" | "dismissed";
subject: | {
id: string;
type: string;
}
| null;
title: string;
type: string;
updatedAt: string;
}>;Claim a task
Take an open task: you hold it (status claimed) and it leaves everyone else's inbox. Claiming one you hold changes nothing; one someone else holds is refused (409 TASK_CLAIMED). Needs tasks.work for its account.
Parameters#
| Parameter | Type |
|---|---|
taskId | string |
requestOptions? | RequestOptions |
Returns#
Promise<{
accountId: string | null;
actions: {
action: string;
closesAs: "done" | "dismissed";
label: string;
requiresNotes: boolean;
}[];
assignee: | {
id: string;
type: "user" | "role" | "account";
}
| null;
availableActions: string[];
claimedAt: string | null;
createdAt: string;
createdBy: string | null;
description: string | null;
details: {
[key: string]: unknown;
};
dueAt: string | null;
id: string;
isTest: boolean;
organisationId: string;
outcome: string | null;
outcomeNotes: string | null;
overdue: boolean;
priority: "low" | "normal" | "high" | "urgent";
queueId: string | null;
resolvedAt: string | null;
resolvedBy: string | null;
resolverKind: "user" | "workflow" | "system" | "app" | null;
source: {
id: string | null;
kind: "user" | "workflow" | "system" | "app";
};
status: "expired" | "open" | "done" | "claimed" | "dismissed";
subject: | {
id: string;
type: string;
}
| null;
title: string;
type: string;
updatedAt: string;
}>
Operation Id#
claimTask
counts()#
counts: (requestOptions?: RequestOptions) => Promise<{
assignedToMe: number;
mine: number;
overdue: number;
queues: {
claimed: number;
name: string;
open: number;
overdue: number;
queueId: string;
}[];
unassigned: number;
}>;Count the inbox's tasks The counts the navigation shows: active tasks waiting on you (and how many of those you hold, and how many are overdue), active tasks waiting on nobody, and each of your queues by open, claimed and overdue. Live tasks only: tasks raised by a failure in test mode are never counted.
Parameters#
| Parameter | Type |
|---|---|
requestOptions? | RequestOptions |
Returns#
Promise<{
assignedToMe: number;
mine: number;
overdue: number;
queues: {
claimed: number;
name: string;
open: number;
overdue: number;
queueId: string;
}[];
unassigned: number;
}>
Operation Id#
getTaskCounts
create()#
create: (request: {
accountId?: string | null;
assignee?: | {
userId: string;
}
| {
roleId: string;
}
| {
accountId: string;
}
| {
queueId: string;
}
| null;
description?: string | null;
details?: {
[key: string]: unknown;
};
dueAt?: string | null;
priority?: "low" | "normal" | "high" | "urgent";
subjectId?: string | null;
title: string;
type: string;
}, requestOptions?: RequestOptions) => Promise<{
accountId: string | null;
actions: {
action: string;
closesAs: "done" | "dismissed";
label: string;
requiresNotes: boolean;
}[];
assignee: | {
id: string;
type: "user" | "role" | "account";
}
| null;
availableActions: string[];
claimedAt: string | null;
createdAt: string;
createdBy: string | null;
description: string | null;
details: {
[key: string]: unknown;
};
dueAt: string | null;
id: string;
isTest: boolean;
organisationId: string;
outcome: string | null;
outcomeNotes: string | null;
overdue: boolean;
priority: "low" | "normal" | "high" | "urgent";
queueId: string | null;
resolvedAt: string | null;
resolvedBy: string | null;
resolverKind: "user" | "workflow" | "system" | "app" | null;
source: {
id: string | null;
kind: "user" | "workflow" | "system" | "app";
};
status: "expired" | "open" | "done" | "claimed" | "dismissed";
subject: | {
id: string;
type: string;
}
| null;
title: string;
type: string;
updatedAt: string;
}>;Raise a task
Raise a task: one unit of work with one outcome, optionally about any record (subjectId, a prefixed id). Only types a person may raise (follow_up today); the platform's own (payment reviews, failed payouts, failing webhooks) it raises itself. The task is for the account that owns its subject, else accountId, else your own. It waits where assignee says; else in the queue that takes its type; else you hold it. Needs tasks.work for that account, and tasks.assign to give it to someone else.
Parameters#
| Parameter | Type | Description |
|---|---|---|
request | { accountId?: string | null; assignee?: | { userId: string; } | { roleId: string; } | { accountId: string; } | { queueId: string; } | null; description?: string | null; details?: { [key: string]: unknown; }; dueAt?: string | null; priority?: "low" | "normal" | "high" | "urgent"; subjectId?: string | null; title: string; type: string; } | - |
request.accountId? | string | null | Description The account the task is for. Defaults to the account that owns the subject (and must agree with it), else your own account when you work tasks for one, else the organisation's own when you work them for every account. |
request.assignee? | | { userId: string; } | { roleId: string; } | { accountId: string; } | { queueId: string; } | null | Description Where the task waits. Left out: the queue that takes its type, else you hold it yourself. Naming yourself or a queue needs tasks.work; anyone else, tasks.assign. Example { * "queueId": "tkq_Q2w8Er5Ty1Ui3Op0As9D" * } |
request.description? | string | null | - |
request.details? | { [key: string]: unknown; } | Description Facts for whoever works the task. |
request.dueAt? | string | null | Format: date-time Description When it is due (ISO-8601). Defaults to the queue's default deadline, if it has one. |
request.priority? | "low" | "normal" | "high" | "urgent" | Description Defaults to the queue's default priority, else the type's. |
request.subjectId? | string | null | Description What the task is about: the prefixed id of any registered object of a type the task type accepts. Example ord_abc123xyz789 |
request.title? | string | Example Call the customer back about the accessible seats |
request.type? | string | Description A task type a person may raise (raisedBy on GET /task-types). Example follow_up |
requestOptions? | RequestOptions | - |
Returns#
Promise<{
accountId: string | null;
actions: {
action: string;
closesAs: "done" | "dismissed";
label: string;
requiresNotes: boolean;
}[];
assignee: | {
id: string;
type: "user" | "role" | "account";
}
| null;
availableActions: string[];
claimedAt: string | null;
createdAt: string;
createdBy: string | null;
description: string | null;
details: {
[key: string]: unknown;
};
dueAt: string | null;
id: string;
isTest: boolean;
organisationId: string;
outcome: string | null;
outcomeNotes: string | null;
overdue: boolean;
priority: "low" | "normal" | "high" | "urgent";
queueId: string | null;
resolvedAt: string | null;
resolvedBy: string | null;
resolverKind: "user" | "workflow" | "system" | "app" | null;
source: {
id: string | null;
kind: "user" | "workflow" | "system" | "app";
};
status: "expired" | "open" | "done" | "claimed" | "dismissed";
subject: | {
id: string;
type: string;
}
| null;
title: string;
type: string;
updatedAt: string;
}>
Operation Id#
createTask
decide()#
decide: (taskId: string, request: {
action: string;
notes?: string | null;
}, requestOptions?: RequestOptions) => Promise<{
accountId: string | null;
actions: {
action: string;
closesAs: "done" | "dismissed";
label: string;
requiresNotes: boolean;
}[];
assignee: | {
id: string;
type: "user" | "role" | "account";
}
| null;
availableActions: string[];
claimedAt: string | null;
createdAt: string;
createdBy: string | null;
description: string | null;
details: {
[key: string]: unknown;
};
dueAt: string | null;
id: string;
isTest: boolean;
organisationId: string;
outcome: string | null;
outcomeNotes: string | null;
overdue: boolean;
priority: "low" | "normal" | "high" | "urgent";
queueId: string | null;
resolvedAt: string | null;
resolvedBy: string | null;
resolverKind: "user" | "workflow" | "system" | "app" | null;
source: {
id: string | null;
kind: "user" | "workflow" | "system" | "app";
};
status: "expired" | "open" | "done" | "claimed" | "dismissed";
subject: | {
id: string;
type: string;
}
| null;
title: string;
type: string;
updatedAt: string;
}>;Decide a task
Close a task with one of its type's actions (resolve, dismiss, ...): it becomes done or dismissed with the outcome and your notes, and task.decided is sent. Some actions need notes. Deciding a task someone else holds needs tasks.assign. Needs tasks.work for its account.
Parameters#
| Parameter | Type | Description |
|---|---|---|
taskId | string | - |
request | { action: string; notes?: string | null; } | - |
request.action | string | Description One of the task type's actions (actions on the task). Example resolve |
request.notes? | string | null | Description Why; required by some actions (requiresNotes), such as dismissing. |
requestOptions? | RequestOptions | - |
Returns#
Promise<{
accountId: string | null;
actions: {
action: string;
closesAs: "done" | "dismissed";
label: string;
requiresNotes: boolean;
}[];
assignee: | {
id: string;
type: "user" | "role" | "account";
}
| null;
availableActions: string[];
claimedAt: string | null;
createdAt: string;
createdBy: string | null;
description: string | null;
details: {
[key: string]: unknown;
};
dueAt: string | null;
id: string;
isTest: boolean;
organisationId: string;
outcome: string | null;
outcomeNotes: string | null;
overdue: boolean;
priority: "low" | "normal" | "high" | "urgent";
queueId: string | null;
resolvedAt: string | null;
resolvedBy: string | null;
resolverKind: "user" | "workflow" | "system" | "app" | null;
source: {
id: string | null;
kind: "user" | "workflow" | "system" | "app";
};
status: "expired" | "open" | "done" | "claimed" | "dismissed";
subject: | {
id: string;
type: string;
}
| null;
title: string;
type: string;
updatedAt: string;
}>
Operation Id#
decideTask
get()#
get: (taskId: string, requestOptions?: RequestOptions) => Promise<{
accountId: string | null;
actions: {
action: string;
closesAs: "done" | "dismissed";
label: string;
requiresNotes: boolean;
}[];
assignee: | {
id: string;
type: "user" | "role" | "account";
}
| null;
availableActions: string[];
claimedAt: string | null;
createdAt: string;
createdBy: string | null;
description: string | null;
details: {
[key: string]: unknown;
};
dueAt: string | null;
id: string;
isTest: boolean;
organisationId: string;
outcome: string | null;
outcomeNotes: string | null;
overdue: boolean;
priority: "low" | "normal" | "high" | "urgent";
queueId: string | null;
resolvedAt: string | null;
resolvedBy: string | null;
resolverKind: "user" | "workflow" | "system" | "app" | null;
source: {
id: string | null;
kind: "user" | "workflow" | "system" | "app";
};
status: "expired" | "open" | "done" | "claimed" | "dismissed";
subject: | {
id: string;
type: string;
}
| null;
title: string;
type: string;
updatedAt: string;
}>;Get a task
A task, with its type's decisions (actions) and what you may do to it now (availableActions). 404 TASK_NOT_FOUND for a task another account owns.
Parameters#
| Parameter | Type |
|---|---|
taskId | string |
requestOptions? | RequestOptions |
Returns#
Promise<{
accountId: string | null;
actions: {
action: string;
closesAs: "done" | "dismissed";
label: string;
requiresNotes: boolean;
}[];
assignee: | {
id: string;
type: "user" | "role" | "account";
}
| null;
availableActions: string[];
claimedAt: string | null;
createdAt: string;
createdBy: string | null;
description: string | null;
details: {
[key: string]: unknown;
};
dueAt: string | null;
id: string;
isTest: boolean;
organisationId: string;
outcome: string | null;
outcomeNotes: string | null;
overdue: boolean;
priority: "low" | "normal" | "high" | "urgent";
queueId: string | null;
resolvedAt: string | null;
resolvedBy: string | null;
resolverKind: "user" | "workflow" | "system" | "app" | null;
source: {
id: string | null;
kind: "user" | "workflow" | "system" | "app";
};
status: "expired" | "open" | "done" | "claimed" | "dismissed";
subject: | {
id: string;
type: string;
}
| null;
title: string;
type: string;
updatedAt: string;
}>
Operation Id#
getTask
list()#
list: (options?: {
accountId?: string;
cursor?: string;
inbox?: "all" | "unassigned" | "mine";
limit?: number;
mode?: "live" | "test" | "all";
overdue?: "true" | "false";
priority?: "low" | "normal" | "high" | "urgent";
queueId?: string;
status?: "expired" | "open" | "done" | "claimed" | "dismissed" | "active";
subjectId?: string;
type?: string;
}, requestOptions?: RequestOptions) => Promise<{
nextCursor: string | null;
tasks: {
accountId: string | null;
actions: {
action: string;
closesAs: "done" | "dismissed";
label: string;
requiresNotes: boolean;
}[];
assignee: | {
id: string;
type: "user" | "role" | "account";
}
| null;
availableActions: string[];
claimedAt: string | null;
createdAt: string;
createdBy: string | null;
description: string | null;
details: {
[key: string]: unknown;
};
dueAt: string | null;
id: string;
isTest: boolean;
organisationId: string;
outcome: string | null;
outcomeNotes: string | null;
overdue: boolean;
priority: "low" | "normal" | "high" | "urgent";
queueId: string | null;
resolvedAt: string | null;
resolvedBy: string | null;
resolverKind: "user" | "workflow" | "system" | "app" | null;
source: {
id: string | null;
kind: "user" | "workflow" | "system" | "app";
};
status: "expired" | "open" | "done" | "claimed" | "dismissed";
subject: | {
id: string;
type: string;
}
| null;
title: string;
type: string;
updatedAt: string;
}[];
}>;List tasks
The tasks you can read, newest first: those of the accounts your tasks.read reaches, and the organisation's own at :all. inbox=mine is your inbox: tasks you hold, and those waiting in a queue you are in, on a role you hold or on an account you work for. inbox=unassigned is what waits on nobody. Filter by status, type, priority, queue, subject, account or overdue; page with cursor. Tasks raised by a failure in test mode are left out unless mode asks for them.
Parameters#
| Parameter | Type |
|---|---|
options? | { accountId?: string; cursor?: string; inbox?: "all" | "unassigned" | "mine"; limit?: number; mode?: "live" | "test" | "all"; overdue?: "true" | "false"; priority?: "low" | "normal" | "high" | "urgent"; queueId?: string; status?: "expired" | "open" | "done" | "claimed" | "dismissed" | "active"; subjectId?: string; type?: string; } |
options.accountId? | string |
options.cursor? | string |
options.inbox? | "all" | "unassigned" | "mine" |
options.limit? | number |
options.mode? | "live" | "test" | "all" |
options.overdue? | "true" | "false" |
options.priority? | "low" | "normal" | "high" | "urgent" |
options.queueId? | string |
options.status? | "expired" | "open" | "done" | "claimed" | "dismissed" | "active" |
options.subjectId? | string |
options.type? | string |
requestOptions? | RequestOptions |
Returns#
Promise<{
nextCursor: string | null;
tasks: {
accountId: string | null;
actions: {
action: string;
closesAs: "done" | "dismissed";
label: string;
requiresNotes: boolean;
}[];
assignee: | {
id: string;
type: "user" | "role" | "account";
}
| null;
availableActions: string[];
claimedAt: string | null;
createdAt: string;
createdBy: string | null;
description: string | null;
details: {
[key: string]: unknown;
};
dueAt: string | null;
id: string;
isTest: boolean;
organisationId: string;
outcome: string | null;
outcomeNotes: string | null;
overdue: boolean;
priority: "low" | "normal" | "high" | "urgent";
queueId: string | null;
resolvedAt: string | null;
resolvedBy: string | null;
resolverKind: "user" | "workflow" | "system" | "app" | null;
source: {
id: string | null;
kind: "user" | "workflow" | "system" | "app";
};
status: "expired" | "open" | "done" | "claimed" | "dismissed";
subject: | {
id: string;
type: string;
}
| null;
title: string;
type: string;
updatedAt: string;
}[];
}>
Operation Id#
listTasks
reassign()#
reassign: (taskId: string, request:
| {
userId: string;
}
| {
roleId: string;
}
| {
accountId: string;
}
| {
queueId: string;
}, requestOptions?: RequestOptions) => Promise<{
accountId: string | null;
actions: {
action: string;
closesAs: "done" | "dismissed";
label: string;
requiresNotes: boolean;
}[];
assignee: | {
id: string;
type: "user" | "role" | "account";
}
| null;
availableActions: string[];
claimedAt: string | null;
createdAt: string;
createdBy: string | null;
description: string | null;
details: {
[key: string]: unknown;
};
dueAt: string | null;
id: string;
isTest: boolean;
organisationId: string;
outcome: string | null;
outcomeNotes: string | null;
overdue: boolean;
priority: "low" | "normal" | "high" | "urgent";
queueId: string | null;
resolvedAt: string | null;
resolvedBy: string | null;
resolverKind: "user" | "workflow" | "system" | "app" | null;
source: {
id: string | null;
kind: "user" | "workflow" | "system" | "app";
};
status: "expired" | "open" | "done" | "claimed" | "dismissed";
subject: | {
id: string;
type: string;
}
| null;
title: string;
type: string;
updatedAt: string;
}>;Reassign a task Hand a task to a person (who then holds it), a role or the account (it waits on them), or a queue (it waits there, held by nobody), taking it from whoever held it. Each must be able to work it: a person with tasks.work for the task's account, the account itself, a queue of that account or of the organisation (else 409 TASK_ASSIGNEE_OUT_OF_REACH). Needs tasks.assign for the task's account.
Parameters#
| Parameter | Type |
|---|---|
taskId | string |
request | | { userId: string; } | { roleId: string; } | { accountId: string; } | { queueId: string; } |
requestOptions? | RequestOptions |
Returns#
Promise<{
accountId: string | null;
actions: {
action: string;
closesAs: "done" | "dismissed";
label: string;
requiresNotes: boolean;
}[];
assignee: | {
id: string;
type: "user" | "role" | "account";
}
| null;
availableActions: string[];
claimedAt: string | null;
createdAt: string;
createdBy: string | null;
description: string | null;
details: {
[key: string]: unknown;
};
dueAt: string | null;
id: string;
isTest: boolean;
organisationId: string;
outcome: string | null;
outcomeNotes: string | null;
overdue: boolean;
priority: "low" | "normal" | "high" | "urgent";
queueId: string | null;
resolvedAt: string | null;
resolvedBy: string | null;
resolverKind: "user" | "workflow" | "system" | "app" | null;
source: {
id: string | null;
kind: "user" | "workflow" | "system" | "app";
};
status: "expired" | "open" | "done" | "claimed" | "dismissed";
subject: | {
id: string;
type: string;
}
| null;
title: string;
type: string;
updatedAt: string;
}>
Operation Id#
reassignTask
release()#
release: (taskId: string, requestOptions?: RequestOptions) => Promise<{
accountId: string | null;
actions: {
action: string;
closesAs: "done" | "dismissed";
label: string;
requiresNotes: boolean;
}[];
assignee: | {
id: string;
type: "user" | "role" | "account";
}
| null;
availableActions: string[];
claimedAt: string | null;
createdAt: string;
createdBy: string | null;
description: string | null;
details: {
[key: string]: unknown;
};
dueAt: string | null;
id: string;
isTest: boolean;
organisationId: string;
outcome: string | null;
outcomeNotes: string | null;
overdue: boolean;
priority: "low" | "normal" | "high" | "urgent";
queueId: string | null;
resolvedAt: string | null;
resolvedBy: string | null;
resolverKind: "user" | "workflow" | "system" | "app" | null;
source: {
id: string | null;
kind: "user" | "workflow" | "system" | "app";
};
status: "expired" | "open" | "done" | "claimed" | "dismissed";
subject: | {
id: string;
type: string;
}
| null;
title: string;
type: string;
updatedAt: string;
}>;Release a task Let go of a claimed task: it goes back to waiting in its queue, or on nobody. Your own needs tasks.work; someone else's, tasks.assign.
Parameters#
| Parameter | Type |
|---|---|
taskId | string |
requestOptions? | RequestOptions |
Returns#
Promise<{
accountId: string | null;
actions: {
action: string;
closesAs: "done" | "dismissed";
label: string;
requiresNotes: boolean;
}[];
assignee: | {
id: string;
type: "user" | "role" | "account";
}
| null;
availableActions: string[];
claimedAt: string | null;
createdAt: string;
createdBy: string | null;
description: string | null;
details: {
[key: string]: unknown;
};
dueAt: string | null;
id: string;
isTest: boolean;
organisationId: string;
outcome: string | null;
outcomeNotes: string | null;
overdue: boolean;
priority: "low" | "normal" | "high" | "urgent";
queueId: string | null;
resolvedAt: string | null;
resolvedBy: string | null;
resolverKind: "user" | "workflow" | "system" | "app" | null;
source: {
id: string | null;
kind: "user" | "workflow" | "system" | "app";
};
status: "expired" | "open" | "done" | "claimed" | "dismissed";
subject: | {
id: string;
type: string;
}
| null;
title: string;
type: string;
updatedAt: string;
}>
Operation Id#
releaseTask