Override task assignee and processVariable

Hi,

I have a process where assignee of userTask is set to {userName}. When process starts, userName is user-1 and the task is created for user-1.

Now I want the task assignee to be changed to user-2. When I call /assignee engine rest endpoint, assignee of the task changes but the process Variable “userName” is still user-1. I want processVariable also to change because this task is part of a workflow loop and same task will be created if manager rejects it in next stage of work flow.

What is best way to do this using engine rest endpoint?

Hi @Rohit_Singh,

you have to call both endpoints: Set assignee (Set Assignee | docs.camunda.org) and update variable (Put Process Variable | docs.camunda.org)

Hope this helps, Ingo

You did mention using engine rest endpoint, but if I may suggest, you can also add a listener to your user task on assignment, which could do the actual update of the process variable, which to me was more convenient for the same use case.