Katy Haddock
As Seth Lewis points out, the Group item's add_users method requires a Python string that is the name of a list, not a string that represents the name of a user. For the instance you describe, it sounds like you can query the gis object representing your GIS, then create a list based on the role. For instance, you could create a list of publishers and add them to a group:
my_gis = GIS("portal url", "user", "password")
portal_users = my_gis.search.users()
list_of_users = [a_user for a_user in portal_users if a_user.role == 'org_publisher']
my_group = my_gis.groups.search("title: <title of your group>")
my_group.add_users(list_of_users)
When successful, the add_users method returns a dictionary with a notAdded key with a list of users that were not added - so an empty list is the ideal value...(Less is definitely more 😞
{notAdded: []}