def create_yt_bundle_custom_field(target, project_id, field_name, trac_field_values, trac_field_to_youtrack_field):
    create_yt_custom_field(target, project_id, field_name, [])
    field_name = trac_field_name_to_yt_field_name(field_name)

    field_bundle = target.getBundle(tracLib.FIELD_TYPES[field_name][0:-3],
                                     target.getProjectCustomField(project_id, field_name).bundle)
    values_to_add = []
    for field in trac_field_values:
        if field_name in tracLib.FIELD_VALUES.keys():
            if field.name in tracLib.FIELD_VALUES[field_name].keys():
                field.name = tracLib.FIELD_VALUES[field_name][field.name]
        values_to_add.append(trac_field_to_youtrack_field(field, field_bundle))
    add_values_to_bundle_safe(target, field_bundle, values_to_add)
Creates YT bundle custom field if needed and attaches it to project with id project_id. If Field is already attached to project,
dataset/ETHPy150Open JetBrains/youtrack-rest-python-library/python/trac2youtrack.py/create_yt_bundle_custom_field