answerApproval method

Future<ApprovalDTO> answerApproval({
  1. required String issueIdOrKey,
  2. required int approvalId,
  3. required ApprovalDecisionRequestDTO body,
})

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.

Implementation

Future<ApprovalDTO> answerApproval(
    {required String issueIdOrKey,
    required int approvalId,
    required ApprovalDecisionRequestDTO body}) async {
  return ApprovalDTO.fromJson(await _client.send(
    'post',
    'rest/servicedeskapi/request/{issueIdOrKey}/approval/{approvalId}',
    pathParameters: {
      'issueIdOrKey': issueIdOrKey,
      'approvalId': '$approvalId',
    },
    body: body.toJson(),
  ));
}