As we transition to the new Hyland Community, some post links may be temporarily disrupted as we finalize redirects. We apologize for the inconvenience and are working to resolve this as quickly as possible. Details.
I want to add bulk users to different different groups (creating group via Webscripts) uusing API service or Java based Web Script.
Thanks,
Pravin Gupta
Hi @PravinGupta,
Take a look at this solution - it might provide the basis for your own solution.
HTH
Hi @EddieMay ,
I think solution provided by you is similar to my requirement but what i want is to Create group if Group is not Present and to add user to that Group(Group present by default or Group newly Created). I think createGroup service is to be used here but how to combine my both statement to Create group if not present and to add user to it
Pravin
When you write, "i want is to Create group if Group is not Present" - you will have to do a group lookup as mentioned in that post I referred to -https://api-explorer.alfresco.com/api-explorer/#!/groups/listGroups. If the group doesn't exist, then you will have to create the group https://api-explorer.alfresco.com/api-explorer/#!/groups/createGroup. To add a person to your existing or new group - https://api-explorer.alfresco.com/api-explorer/#!/groups/createGroupMembership - here's the documentation.
Also look at this api - https://api-explorer.alfresco.com/api-explorer/#!/groups/listGroupMembershipsForPerson & this documentation to see if the user belongs to a group or groups.
In psuedo code:
if (!group exist) { create group add user to group } else if (!user member of group) { add user to group }
I think that might work. Caveat: Not tested!
HTH,