getRequestComments method

Future<PagedDTOCommentDTO> getRequestComments({
  1. required String issueIdOrKey,
  2. bool? public,
  3. bool? internal,
  4. List<String>? expand,
  5. int? start,
  6. int? limit,
})

This method returns all comments on a customer request. No permissions error is provided if, for example, the user doesn't have access to the service desk or request, the method simply returns an empty response.

Permissions required: Permission to view the customer request.

Response limitations: Customers are returned public comments only.

Implementation

Future<PagedDTOCommentDTO> getRequestComments(
    {required String issueIdOrKey,
    bool? public,
    bool? internal,
    List<String>? expand,
    int? start,
    int? limit}) async {
  return PagedDTOCommentDTO.fromJson(await _client.send(
    'get',
    'rest/servicedeskapi/request/{issueIdOrKey}/comment',
    pathParameters: {
      'issueIdOrKey': issueIdOrKey,
    },
    queryParameters: {
      if (public != null) 'public': '$public',
      if (internal != null) 'internal': '$internal',
      if (expand != null) 'expand': expand.map((e) => e).join(','),
      if (start != null) 'start': '$start',
      if (limit != null) 'limit': '$limit',
    },
  ));
}