Add assignee to particular group instead of entire task

hi all,can any one help on this.

here im assigning a task to 2 different CandidateGroups.

delegateTask.addCandidateGroups(["groupName1","groupName2"]);

later when user login with any one of the group say group1 then assignee should be set for only to group1 not for entire task how to do this?can anyone please help on this use case.

Thank you.