# How to change the userTask's name according to process variables

**URL:** <https://forum.camunda.io/t/how-to-change-the-usertasks-name-according-to-process-variables/28467>\
**Category:** Discussion & Questions\
**Created:** [June 28, 2021, 12:19pm UTC](https://forum.camunda.io/t/how-to-change-the-usertasks-name-according-to-process-variables/28467 "2021-06-28T12:19:06Z")\
**Posts on this page:** 1\
**Showing post:** 16

<div class="post-metadata">

**Author:** ![Ingo\_Richtsmeier](https://forum.camunda.io/user_avatar/forum.camunda.io/ingo_richtsmeier/32/25968_2.png) [@Ingo\_Richtsmeier](https://forum.camunda.io/u/Ingo_Richtsmeier)\
**Post date:** [June 28, 2021, 6:25pm UTC](https://forum.camunda.io/t/how-to-change-the-usertasks-name-according-to-process-variables/28467/16 "2021-06-28T18:25:30Z")

</div>

Hi @rezza72,

the easiest way is to use a task listener on the create event and use the `name` attribute of the provided `task` object.

For example:

```auto
    <bpmn:userTask id="Activity_02328bn" name="${taskTitle}" camunda:assignee="${prc_starter_user_uri}">
      <bpmn:extensionElements>
        <camunda:taskListener event="create">
          <camunda:script scriptFormat="javascript">task.setName("Hallo Rezza");</camunda:script>
        </camunda:taskListener>
      </bpmn:extensionElements>
    </bpmn:userTask>

```

To add additional logic, surround the statement with if-then-else. And choose the scripting language (or Java) you like most.

Hope this helps, Ingo

---

_[View the full topic](https://forum.camunda.io/t/how-to-change-the-usertasks-name-according-to-process-variables/28467)._
