Candidate group deleted from task after its assigned to the user

HI ,
I added two candidate groups to a task.
Then I assigned the task to a user.
Now there are not tasks for the candidate group.

    Task task = taskService.newTask();
    task.setName("assignee task 2");
    taskService.saveTask(task);

    taskService.addCandidateGroup(task.getId(),"group-1");
    taskService.addCandidateGroup(task.getId(),"group-2");
    assertThat(taskService.createTaskQuery().taskCandidateGroup("group-1").list().size()).isEqualTo(1);

    taskService.setAssignee(task.getId(),"user-1");
    assertThat(taskService.createTaskQuery().taskCandidateGroup("group-1").list().size()).isEqualTo(1);//Fails

The second assertion fails.
Is this the way its supposed to work (As once the task is assigned to a user, then it should be removed from the candidate group_ ?

Yes. Once a task is assigned, the task is not a candidate anymore for anyone else.

1 Like