Hi Nathan!
It’s meant for a rather specific use case where you want to ensure that users belong to a certain group based on a custom field that they filled in on signup.
Let’s say the custom field is “favorite soccer team” and it contains a list of choices. The script runs on a recurring trigger, so users will eventually end up belonging to a group with the same full name (not just name) as the value they chose, if the group exists.
You can look at the tests for some synthetic examples: https://github.com/discourse/discourse-automation/blob/main/spec/scripts/add_user_to_group_through_custom_field_spec.rb