getCustomerRequests method

Future<PagedDTOCustomerRequestDTO> getCustomerRequests({
  1. String? searchTerm,
  2. List<String>? requestOwnership,
  3. String? requestStatus,
  4. String? approvalStatus,
  5. int? organizationId,
  6. int? serviceDeskId,
  7. int? requestTypeId,
  8. List<String>? expand,
  9. int? start,
  10. int? limit,
})

This method returns all customer requests for the user executing the query.

The returned customer requests are ordered chronologically by the latest activity on each request. For example, the latest status transition or comment.

Permissions required: Permission to access the specified service desk.

Response limitations: For customers, the list returned will include request they created (or were created on their behalf) or are participating in only.

Implementation

Future<PagedDTOCustomerRequestDTO> getCustomerRequests(
    {String? searchTerm,
    List<String>? requestOwnership,
    String? requestStatus,
    String? approvalStatus,
    int? organizationId,
    int? serviceDeskId,
    int? requestTypeId,
    List<String>? expand,
    int? start,
    int? limit}) async {
  return PagedDTOCustomerRequestDTO.fromJson(await _client.send(
    'get',
    'rest/servicedeskapi/request',
    queryParameters: {
      if (searchTerm != null) 'searchTerm': searchTerm,
      if (requestOwnership != null)
        'requestOwnership': requestOwnership.map((e) => e).join(','),
      if (requestStatus != null) 'requestStatus': requestStatus,
      if (approvalStatus != null) 'approvalStatus': approvalStatus,
      if (organizationId != null) 'organizationId': '$organizationId',
      if (serviceDeskId != null) 'serviceDeskId': '$serviceDeskId',
      if (requestTypeId != null) 'requestTypeId': '$requestTypeId',
      if (expand != null) 'expand': expand.map((e) => e).join(','),
      if (start != null) 'start': '$start',
      if (limit != null) 'limit': '$limit',
    },
  ));
}