def import_role(target, project_id, role):
    if u'members' not in role:
        return
    users_to_import = []
    members = role[u'members']
    for member in members:
        users_to_import.append(to_yt_user(member))
    target.importUsers(users_to_import)
    group = Group()
    group.name = project_id + "-" + role[u'name']
    try:
        target.createGroup(group)
    except YouTrackException, e:
        log_message(e)
    for member in members:
        try:
            target.setUserGroup(member[u'userName'], group.name)
        except YouTrackException, e:
            log_error(e)
dataset/ETHPy150Open JetBrains/youtrack-rest-python-library/python/agilezen2youtrack.py/import_role/original