...
Go to Profile > Project Mapping > Issue > Edit
Under CUSTOM FIELDS DEFAULTS you will see the available custom fields for the project mapping's project.
Find your custom field, select Velocity and when you want the field to be updated e.g. On Create/Comment.
Enter the relevant script within the text-box
See the following page for some example Velocity Scripts: Velocity Script Examples
...