Is there a way to trigger 1+ actions or a custom script when a device gets added to a group?
Is there a way to trigger 1+ actions or a custom script when a device gets added to a group?
Do you want the script applied to the device that has been added? If so, then yes you can do this in a number of different ways. You could have a Package containing just a post-install script in a Profile assigned to the group so devices added install it, and run the script automatically. You could also create a Profile containing a Task Scheduler configuration with a one time running script and have that assigned to the group as well. You could also have a File Sync rule that executes a Post Sync Script assigned to the Group. I think you may even be able to accomplish this using Alerts, but I'm less familiar there.
To use an alert rule to trigger a script of action for Android platform device added to a device group, you can add a UNIQUE profile targeted only to that group.
The alert rule is triggered with an "Profile installed" event, and has "Execute script on device" enabled in the Actions tab, and is targeted only to the device group of interest. If there are other profiles(s) targeted to this group and your script can only be executed once and only once upon being added to the group, then you might additionally need to use conditional construct in your script to distinguish between this unique profile associated with device added action and other profile(s).