There is currently a script in the Automation plugin to add users to a group based on a custom field. We would like a script to add users to a group, when they’re added to another group.
The scenario is this: The Discourse Experts plugin expects you to only have one user group designated for “experts”. We are running an ambassador program and have two tiers of ambassadors—both of which are “experts” in this case.
We would like to say, anyone added to “Ambassadors” or “Expert Ambassadors” also gets added to the “Experts” user group.
I’m noting this just to make sure that adding an Automation script is the best way to deal with this, or if it’s functionality that should get added to the core Discourse groups code.
I’ve been fiddling around with this for fun. It’s kind of related to some recent work I’ve been doing with Zapier. Feel free to ignore the rest of this post.
Assuming an Automation script is the right approach, the only stumbling block is that the Automation plugin’s group component only accepts a single group. So either the group component needs to be updated to accept more than one group, or a new groups component needs to be added. I added a groups component to my local dev branch to test it out. With that in place:
Add a user to a parent group when they are added to any of a list of subgroups: