I don't have a full script to do this. But this is something that you could probably work up using Jira's REST API. There is an endpoint called api/2/group/user
This endpoint allows you to add a given user to a group.
You could use a utility like curl to make these calls, or you could use something like python. More examples in Jira REST API examples.
Note: These groups will have to exist in the Jira Internal directory for you to be able to modify the group memberships this way. If the groups are coming into Jira from an external directory (LDAP/Active Directory), then Jira does not actually have control over the user group memberships in most cases. In those cases the user memberships are determined by the external directory itself.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.