After leveraging (and learning CSOM) for Sharepoint, I've been able to solve this issue. Please see the code below if you are trying to accomplish this as well. I'm using it currently in an Event Sign-Up application on my intranet.
function addPerson() {
var oListItem = getCurrentItem();
var users = new Array();
NWF$('.ip-item span div:not(.ip-close)').each(
function() {
users.push(SP.FieldUserValue.fromUser(this.innerHTML));
}
);
users.push(SP.FieldUserValue.fromUser('Current User (Display Name)'));
oListItem.set_item('_x0023__x0020_Signed_x0020_Up', users.length);
oListItem.set_item('testChoice', 1);
oListItem.set_item('Attendees', users);
oListItem.update();
clientContext.executeQueryAsync(Function.createDelegate(this, this.onQuerySucceededAdd), Function.createDelegate(this, this.onQueryFailed));
}
function onQuerySucceededAdd() {
alert('You have been added to the list.');
location.reload();
}
function onQueryFailed(sender, args) {
alert('Request failed. ' + args.get_message() + '
' + args.get_stackTrace());
}
function getCurrentItem() {
var oList = clientContext.get_web().get_lists().getByTitle('List Name');
this.oListItem = oList.getItemById(ID);
return oListItem;
}
And the opposite to this (remove person) is as follows
function removePerson() {
var oListItem = getCurrentItem();
var users = new Array();
NWF$('.ip-item span div:not(.ip-close)').each(
function() {
if (this.innerHTML != 'Current User (Display Name)') {
users.push(SP.FieldUserValue.fromUser(this.innerHTML));
}
}
);
oListItem.set_item('Attendees', users);
oListItem.set_item('_x0023__x0020_Signed_x0020_Up', users.length);
oListItem.set_item('testChoice', 2);
oListItem.update();
clientContext.executeQueryAsync(Function.createDelegate(this, this.onQuerySucceededRemove), Function.createDelegate(this, this.onQueryFailed));
}
function onQuerySucceededRemove() {
alert('You have been removed from the list.');
location.reload();
}