How to override User task assignee value

Hi,
I want to override assignee value in one user task.

Initially added one value in assignee to one user but I want to change from backend. Can please help me how to override this assignee value.

am new to camunda pls help

Hi @anji87543,
You could use a process variable for task’s Assignee property and set it up like that: ${UserName}.
Now, it depends how you’re back-end looks like, but there are many options to set a value to a process variable. Sometimes it is simple to get it from the task’s form, having an input mapped to the variable,
or set it via client script.

Let me know if that helps.

@anji87543 If you want to change the assignee in backend, then you have to add a task listener to the usertask and then you can set like the below:

public class TaskUpdateListener implements TaskListener {
  
  @Override
  public void notify(DelegateTask delegateTask) {
	delegateTask.setAssignee((String) delegateTask.getVariable("assigneeVariable"));
  }
}

In this example, i was setting the assignee value for the task from the processvariable “assigneeVariable”

Thanks Roman. But here I want to override from backend means db level.
Here my query is initially using Assignee property I assigned to value and posting txn to camunda task with another assignee value here camunda throwing error bcz assignee is not matching…

Thanks Aravindhrs. But here I want to override from backend means db level.
Here my query is initially using Assignee property I assigned to value and posting txn to camunda task with another assignee value here camunda throwing error bcz assignee is not matching…Or any process to replace original assignee value using camunda cockpit

@anji87543 you can check in the table ACT_HI_IDENTITYLINK table and query for taskid and update it