Unset owner of UserTask


I tried to “unset” an owner of a UserTask this way:

taskService.setOwner(taskId, null);

and got the exception

org.camunda.bpm.engine.ProcessEngineException: userId and groupId cannot both be null
    at org.camunda.bpm.engine.impl.cmd.AddIdentityLinkCmd.validateParams(AddIdentityLinkCmd.java:66)

Just want to ask if this is by design and if it is not allowed to set the owner to null once it was set or if I missed how to unset the owner.


You can unclaim the task:

As per the task lifecycle: https://docs.camunda.org/manual/7.4/webapps/tasklist/task-lifecycle/

See the claim method description for how to unclaim using the Java API: https://docs.camunda.org/javadoc/camunda-bpm-platform/7.5/org/camunda/bpm/engine/TaskService.html#claim(java.lang.String,%20java.lang.String)

Hi @StephenOTT,

unclaim only affects the assignee of the task but I want to set the owner back to null (which I once set by using TaskService.setOwner).

The task lifecycle unfortunately does not handle the owner.

Kind regards,

1 Like

Sorry about that! My brain read your question wrong :slight_smile: