The gist of how I do this is to get a list of portal users, and compare the user to my "source" user:
userresp = invokeurl
[
url :endPoint + portalId + "/users/"
type :GET
connection:"projectusers"
];
//info userresp;
users = userresp.getJSON("users").toJSONList();
for each user in users
{
curruser = user.getJSON("name");
if(curruser == salesperson1)
{
salesperson1id = user.getJSON("id");
//info "Sales Person: " + salesperson1;
//info "Sales Person ID: " + salesperson1id;
}
...
}
I then try an update using a map with this entry:
editmp2.put("UDF_USER1",salesperson1id);
if salesperson1id belongs to an admin or portal owner, everything works. The other profiles fail.