Skip to content

Function: answerApproval() ​

ts
function answerApproval(
   client, 
   parameters, 
   options?
): Promise<{
[key: string]: unknown;
  _links?: {
   [key: string]: unknown;
     self?: string;
  };
  approvers?: object[];
  canAnswerApproval?: boolean;
  completedDate?: {
   [key: string]: unknown;
     epochMillis?: number;
     friendly?: string;
     iso8601?: string;
     jira?: string;
  };
  createdDate?: {
   [key: string]: unknown;
     epochMillis?: number;
     friendly?: string;
     iso8601?: string;
     jira?: string;
  };
  finalDecision?: "pending" | string & object | "approved" | "declined";
  id?: string;
  name?: string;
}>;

Defined in: src/serviceDesk/api/request.ts:260

This method enables a user to Approve or Decline an approval on a customer request. The approval is assumed to be owned by the user making the call.

Permissions required: User is assigned to the approval request.

Parameters ​

ParameterTypeDescription
clientClient-
parameters{ approvalId: number; decision?: string & object | "approve" | "decline"; issueIdOrKey: string; }-
parameters.approvalIdnumberThe ID of the approval to be updated.
parameters.decision?string & object | "approve" | "decline"Response to the approval request.
parameters.issueIdOrKey?stringThe ID or key of the customer request to be updated.
options?RequestOptions-

Returns ​

Promise<{ [key: string]: unknown; _links?: { [key: string]: unknown; self?: string; }; approvers?: object[]; canAnswerApproval?: boolean; completedDate?: { [key: string]: unknown; epochMillis?: number; friendly?: string; iso8601?: string; jira?: string; }; createdDate?: { [key: string]: unknown; epochMillis?: number; friendly?: string; iso8601?: string; jira?: string; }; finalDecision?: "pending" | string & object | "approved" | "declined"; id?: string; name?: string; }>