Using Velocity to set custom fields
When using a Velocity value type for a custom field default, the rendered output of the Velocity template is set as the value for the custom field. See more Velocity examples.
Unfamiliar with Velocity templates? For more information about using them, see the Apache Velocity Engine - User Guide.
Velocity Context
When you create a dynamic Custom Field Default, you can make use of special variables found in the ‘context’, see them through:
Profile > Project Mapping > Issue > Edit
Steps to set create a Velocity Custom Field Default
Default custom field values are set in Project Mapping and resolved when an email is processed.
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