Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I am trying to create groups on a SharePoint 2010 site via the UserGroup.asmx web service. I am using jQuery and SPServices to interact with the web service.

When I try to create a group (via the AddGroup method) which is owned by a user it works fine:

groupName: "NewGroup",
ownerIdentifier: "UserOwner",
ownerType: "user"

When I specify another group as the owner I get a 400 error and a "Group cannot be found error":

groupName: "NewGroup",
ownerIdentifier: "GroupOwner",
ownerType: "group"

Using the same group name (GroupOwner) however, I can find it using the GetGroupInfo method of the UserGroups.asmx web service. I have also tried setting the ownerIdentifier to the ID of GroupOwner, which produced a 500 error.

Every example I can find of the AddGroup method only ever specifies users as ownerIdentifier.

I am at a loss at this point - does anyone have any suggestions as to either what I'm doing wrong or where I should be looking for more information?

share|improve this question
add comment

2 Answers

This appears to be an error in my code. I was not properly escaping the name of GroupOwner. I was sending A&Z Group and I should have been sending A&Z Group.

Once I rectified that the new group was created with no problems.

share|improve this answer
add comment

You could try to use the ULS Viewier to aid you in debugging your problem.

But another options is to use Client Object Model to work with the groups, like this:

var ctx = new SP.ClientContext();
var group = new SP.GroupCreationInformation();
group.set_title('Test');
group.set_description('Oh hai');
ctx.get_web().get_siteGroups().add(group);
ctx.executeQueryAsync();
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.