def create_value(target, value, field_name, field_type, project_id):
    if (field_type is not None) and field_type.startswith('user'):
        create_user(target, value)
        value = value.replace(' ', '_')
    if field_name in jira.EXISTING_FIELDS:
        return
    if field_name.lower() not in [field.name.lower() for field in target.getProjectCustomFields(project_id)]:
        if field_name.lower() not in [field.name.lower() for field in target.getCustomFields()]:
            target.createCustomFieldDetailed(field_name, field_type, False, True, False, {})
        if field_type in ['string', 'date', 'integer']:
            target.createProjectCustomFieldDetailed(project_id, field_name, "No " + field_name)
        else:
            bundle_name = field_name + " bundle"
            create_bundle_safe(target, bundle_name, field_type)
            target.createProjectCustomFieldDetailed(project_id, field_name, "No " + field_name, {'bundle': bundle_name})
    if field_type in ['string', 'date', 'integer']:
        return
    project_field = target.getProjectCustomField(project_id, field_name)
    bundle = target.getBundle(field_type, project_field.bundle)
    try:
        if isinstance(value, str):
            target.addValueToBundle(bundle, value)
        elif hasattr(value, 'name'):
            target.addValueToBundle(bundle, value.name)
        elif hasattr(value, 'value'):
            target.addValueToBundle(bundle, value.value)
    except YouTrackException:
        pass
dataset/ETHPy150Open JetBrains/youtrack-rest-python-library/python/jiraSOAP2youtrack.py/create_value/original