getOrganizations method

Future<PagedDTOOrganizationDTO> getOrganizations({
  1. int? start,
  2. int? limit,
  3. String? accountId,
})

This method returns a list of organizations in the Jira Service Management instance. Use this method when you want to present a list of organizations or want to locate an organization by name.

Permissions required: Any. However, to fetch organizations based on accountId the user must have a Service Desk agent license.

Response limitations: If the user is a customer, only those organizations of which the customer is a member are listed.

Implementation

Future<PagedDTOOrganizationDTO> getOrganizations(
    {int? start, int? limit, String? accountId}) async {
  return PagedDTOOrganizationDTO.fromJson(await _client.send(
    'get',
    'rest/servicedeskapi/organization',
    queryParameters: {
      if (start != null) 'start': '$start',
      if (limit != null) 'limit': '$limit',
      if (accountId != null) 'accountId': accountId,
    },
  ));
}