06-03-2020 05:42 AM
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
06-03-2020 08:11 AM
Hi @PravinGupta,
Take a look at this solution - it might provide the basis for your own solution.
HTH
06-03-2020 09:43 AM
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
Thanks,
Pravin
06-03-2020 12:27 PM
Hi @PravinGupta,
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,
Explore our Alfresco products with the links below. Use labels to filter content by product module.