in src/YouTrackSharp/Management/UserManagementService.cs [263:283]
public async Task RemoveUserFromGroup(string username, string group)
{
var client = await _connection.GetAuthenticatedApiClient();
var user = await GetUser(username);
var apiGroups = await client.HubApiUsergroupsGetAsync("name:{" + group + "}", "id", 0, -1);
var apiGroup = apiGroups.Usergroups.FirstOrDefault();
if (user == null)
{
throw new YouTrackErrorException(Strings.Exception_BadRequest, (int)HttpStatusCode.BadRequest,
"Could not find user with login " + username, null, null);
}
if (apiGroup == null)
{
throw new YouTrackErrorException(Strings.Exception_BadRequest, (int)HttpStatusCode.BadRequest,
"Could not find group with name " + group, null, null);
}
await client.HubUsergroupsUsersDeleteAsync(apiGroup.Id, user.RingId);
}