getProjectVersions method

Future<List<Version>> getProjectVersions({
  1. required String projectIdOrKey,
  2. String? expand,
})

Returns all versions in a project. The response is not paginated. Use Get project versions paginated if you want to get the versions in a project with pagination.

This operation can be accessed anonymously.

Permissions required: Browse Projects project permission for the project.

Implementation

Future<List<Version>> getProjectVersions(
    {required String projectIdOrKey, String? expand}) async {
  return (await _client.send(
    'get',
    'rest/api/3/project/{projectIdOrKey}/versions',
    pathParameters: {
      'projectIdOrKey': projectIdOrKey,
    },
    queryParameters: {
      if (expand != null) 'expand': expand,
    },
  ) as List<Object?>)
      .map((i) => Version.fromJson(i as Map<String, Object?>? ?? const {}))
      .toList();
}