Assign an IT policy to a group

To assign an IT policy to a group, you can use the attachITPolicyToGroup() method.
Before you begin: Retrieve the following integers:
  • itPolicyID integer for the ID of the IT policy that you want to assign to the group
  • groupID integer for the ID of the group that you want to assign the IT policy to
  1. Invoke attachITPolicyToGroup().
    AttachITPolicyToGroup request = new attachITPolicyToGroup();
    request.groupId = groupID;
    request.itPolicyId = itPolicyID;
    AttachITPolicyToGroupResponse response = coreWebService.attachITPolicyToGroup(request);
    AttachITPolicyToGroupResult result = response.returnValue;
  2. Check the result for errors and handle any errors.
    if (result.attachITPolicyToGroupReturnStatus.code != AttachITPolicyToGroupReturnStatusEnumType.SUCCESS) 
        // handle any errors

Was this information helpful? Send us your comments.