Hi @Daniel
Currently, there is no "out of the box" solution for this and some script code will be necessary.
Out of the box, you can only assign a task to a specific user or a specific role, and some special roles (SYSTEM, CREATOR, SELF).
For everything else you need to apply your own logic.