Discourse Automation 'Add user to group though User Custom Field' not working

AI-generated summary

The discussion centers on a bug where the Discourse automation feature fails to add users to groups based on custom user fields. Paul_King reports that despite matching the custom field name with the group name and setting the script to run frequently, users are not being added. He notes the absence of a UI field to explicitly nominate the target group.

Lilly suggests following a specific guide, emphasizing that the custom user setting must be a dropdown with options matching the group names. However, Paul_King clarifies that dropdowns are unsuitable for his use case. He requires users to apply for either one or both of two separate groups during signup. Consequently, he uses two distinct custom user fields with tick boxes to allow users to opt in or out of each group independently. He further highlights a critical issue: users approved for only one group have no mechanism to join or switch to the other group themselves after approval.

Unless I am missing something there is no field in the UI in which to nominate the group that the users should be added to.
I wondered if it was assumed that the custom user field and the group would have the same name - but even matching these names, and setting the script to activate every minute, did not result in users with the nominated custom user field ticked in their user profile being added to the group of the same name.

Did you follow this? make sure the custom user setting is a dropdown and that the options match the names you have setup.

2 Likes

Hi @Lilly. In this case dropdown options don’t work, because a person signing up needs to be able to apply to either or both groups I have set up, so I have just used two custom user fields each with a tick box to op in or out of that group.

Also important is that people who are only approved to join one group have no way to join or switch to the other group themselves once approved.

1 Like