getRequestTypeFields method

Future<CustomerRequestCreateMetaDTO> getRequestTypeFields({
  1. required String serviceDeskId,
  2. required int requestTypeId,
  3. List<String>? expand,
})

This method returns the fields for a service desk's customer request type.

Also, the following information about the user's permissions for the request type is returned:

  • canRaiseOnBehalfOf returns true if the user has permission to raise customer requests on behalf of other customers. Otherwise, returns false.
  • canAddRequestParticipants returns true if the user can add customer request participants. Otherwise, returns false.

Permissions required: Permission to view the Service Desk. However, hidden fields would be visible to only Service desk's Administrator.

Implementation

Future<CustomerRequestCreateMetaDTO> getRequestTypeFields(
    {required String serviceDeskId,
    required int requestTypeId,
    List<String>? expand}) async {
  return CustomerRequestCreateMetaDTO.fromJson(await _client.send(
    'get',
    'rest/servicedeskapi/servicedesk/{serviceDeskId}/requesttype/{requestTypeId}/field',
    pathParameters: {
      'serviceDeskId': serviceDeskId,
      'requestTypeId': '$requestTypeId',
    },
    queryParameters: {
      if (expand != null) 'expand': expand.map((e) => e).join(','),
    },
  ));
}