def add_values_to_fields(connection, project_id, mantis_field_name, values, mantis_value_to_yt_value):
    field_name = get_yt_field_name(mantis_field_name, connection)
    pcf = connection.getProjectCustomField(str(project_id), field_name)
    if hasattr(pcf, "bundle"):
        value_mapping = mantis.FIELD_VALUES[field_name] if field_name in mantis.FIELD_VALUES else {}
        bundle = connection.getBundle(pcf.type[0:-3], pcf.bundle)
        yt_values = [v for v in [mantis_value_to_yt_value(value, bundle, value_mapping) for value in values] if
                     len(v.name)]
        add_values_to_bundle_safe(connection, bundle, yt_values)
Adds values to custom fields, which are mapped with mantis_field_name field.
dataset/ETHPy150Open JetBrains/youtrack-rest-python-library/python/mantis2youtrack.py/add_values_to_fields