def export_features(organisation_id: int) -> typing.List[dict]:  # type: ignore[type-arg]
    """
    Export all features and related entities, except ChangeRequests.
    """

    feature_states = []
    for feature_state in _export_entities(
        _EntityExportConfig(
            FeatureState, Q(feature__project__organisation__id=organisation_id)
        )
    ):
        # Since we're not exporting any user objects, we want to exclude change
        # requests from the export. This means, however, that we need to remove the
        # FK dependency on the change request from the FeatureState before export.
        feature_state["fields"]["change_request"] = None
        feature_states.append(feature_state)

    return (
        _export_entities(
            _EntityExportConfig(
                Feature,
                Q(project__organisation__id=organisation_id),
                exclude_fields=["owners", "group_owners"],
            ),
            _EntityExportConfig(
                EnvironmentFeatureVersion,
                Q(feature__project__organisation__id=organisation_id),
                exclude_fields=["created_by", "published_by"],
            ),
            _EntityExportConfig(
                MultivariateFeatureOption,
                Q(feature__project__organisation__id=organisation_id),
            ),
            _EntityExportConfig(
                FeatureSegment,
                Q(feature__project__organisation__id=organisation_id),
            ),
        )
        + feature_states  # feature states need to be imported in correct order
        + _export_entities(
            _EntityExportConfig(
                FeatureStateValue,
                Q(feature_state__feature__project__organisation__id=organisation_id),
            ),
            _EntityExportConfig(
                MultivariateFeatureStateValue,
                Q(feature_state__feature__project__organisation__id=organisation_id),
            ),
        )
    )

    Export all features and related entities, except ChangeRequests.
    
api/import_export/export.py