Skip to content

Function: getTask() ​

ts
function getTask(
   client, 
   parameters, 
   options?
): Promise<{
[key: string]: unknown;
  description?: string;
  elapsedRuntime: number;
  finished?: number;
  id: string;
  lastUpdate: number;
  message?: string;
  progress: number;
  result?: unknown;
  self: string;
  started?: number;
  status:   | string & object
     | "ENQUEUED"
     | "RUNNING"
     | "COMPLETE"
     | "FAILED"
     | "CANCEL_REQUESTED"
     | "CANCELLED"
     | "DEAD";
  submitted: number;
  submittedBy: number;
}>;

Defined in: src/cloud/api/tasks.ts:22

Returns the status of a long-running asynchronous task.

When a task has finished, this operation returns the JSON blob applicable to the task. See the documentation of the operation that created the task for details. Task details are not permanently retained. As of September 2019, details are retained for 14 days although this period may change without notice.

Deprecation notice: The required OAuth 2.0 scopes will be updated on June 15, 2024.

  • read:jira-work

Permissions required: either of:

Parameters ​

ParameterTypeDescription
clientClient-
parameters{ taskId: string; }-
parameters.taskIdstringThe ID of the task.
options?RequestOptions-

Returns ​

Promise<{ [key: string]: unknown; description?: string; elapsedRuntime: number; finished?: number; id: string; lastUpdate: number; message?: string; progress: number; result?: unknown; self: string; started?: number; status: | string & object | "ENQUEUED" | "RUNNING" | "COMPLETE" | "FAILED" | "CANCEL_REQUESTED" | "CANCELLED" | "DEAD"; submitted: number; submittedBy: number; }>