Assign tasks dynamically

Hello.

is there a way I can assign tasks dinamically, based in the amount of tasks each user have?

I want to assign the incoming task to the user which has the least amount.