Reassigning the task to other user

I’m working on a project where we should reassign the same task to other user in the same group after a certain period of time if the tasks are pending. If is possible?. If possible please let me know how to achieved that.

Hi @shashanka_1903,

you can use a task listener on the timeout event to get it done: Delegation Code | docs.camunda.org

Hope this helps, Ingo

1 Like

Yes, Once after the time out how to assign the same task to other user and is it possible to do with java script or python script.
I’m getting this error


Its asking to create some class…how to proceed further
Can u tell me clearly how to achieved this [using python script or java script]

Hi @shashanka_1903,

in case you have Java script installed (it was removed from the JVM in Java >= 15 (Scripting | docs.camunda.org)), you can add a listener like this:

    <bpmn:userTask id="Activity_0q9c0md" name="Review tweet" camunda:formRef="reviewForm" camunda:formRefBinding="latest" camunda:candidateGroups="management">
      <bpmn:extensionElements>
        <camunda:taskListener event="timeout" id="reassign">
          <camunda:script scriptFormat="javascript">task.setAssignee("john")</camunda:script>
          <bpmn:timerEventDefinition id="TimerEventDefinition_0nq438u">
            <bpmn:timeDuration xsi:type="bpmn:tFormalExpression">PT30S</bpmn:timeDuration>
          </bpmn:timerEventDefinition>
        </camunda:taskListener>
      </bpmn:extensionElements>
      <bpmn:incoming>Flow_0warwwp</bpmn:incoming>
      <bpmn:outgoing>Flow_0g00z1h</bpmn:outgoing>
    </bpmn:userTask>

The callenge is to find the real assignee and replace my constant value john with dynamic input.

Hope this helps, Ingo

1 Like