Create a security group that has the Dynamic User membership type. A dynamic user membership type allows users to be automatically added to or removed from the group based on specific criteria, such as department attributes. This ensures that when a new user is added or transferred to a different department, their group membership is updated automatically. Update the user properties. User properties, like department attributes, need to be kept up to date for dynamic groups to work correctly. By ensuring that the user's department field is correctly populated and maintained, the system will automatically place the user in the appropriate department group.