Custom Field Defaults

Summary

Custom field defaults allow static or dynamic values to be defined for custom fields in an issue.  These values can be configured to be applied to an issue during issue creation and/or comment.  Field values are inherited, meaning for example that a value for a field set at the project mapping level will be inherited by all of that mappings rules, unless overridden at the rule level.

Creating a Custom Field Default

  1. Click New Custom Field Default. This will then create a new Custom Field Default with some example values.

     

  2. Now press Edit. This will open the Custom Field Default editor.

  3. Now select/enter relevant values for this Custom Field Default and press Submit to save the configuration:

  4. Once the parameters of the custom field default have been defined as desired, click submit to save changes.  The newly configured default will be present in the list on the mapping:

Configuration Options

Custom Field

The custom field that the value will be used for.  If there is a project defined in the associated project mapping, then only fields applicable for the projects issue types will be shown. 

Field Value Type

The type of value that is going to be defined.  Options are:

  1. Simple Text Value - standard static values

  2. Velocity Scripted Value - uses Velocity Template Language (VTL) script to render dynamic values

  3. Script Value - uses JavaScript to render dynamic values

Value

If the selected field value type is Simple Text Value, then the static value(s) will be entered here.  If the value type is Velocity Scripted Value, then the VTL script will be entered here. If value type is Script Value, then the JavaScript will be entered here.

Apply Rule

This is used to determine when the Custom Field Default should be applied. Current options are:

  1. Create only

  2. Comment only

  3. Create and Comment

Setting Dynamic Values using Scripting

Within Custom Field Defaults you are able to create Custom Scripts which will allow values to be set based on the email content. Scripting can be used with either Velocity or JavaScript.

For more info see:

  1. Velocity: https://thepluginpeople.atlassian.net/wiki/spaces/JEMH/pages/3829039105

  2. JavaScript: https://thepluginpeople.atlassian.net/wiki/spaces/JEMH/pages/3828482056

Inheritance of Custom Field Defaults

Custom field defaults are inherited in the project mapping hierarchy.  Defaults created on a default project mapping are inherited by other non-default project mappings.  Defaults created on a standard project mapping are inherited by that project mapping's children (mapping rules).  To override an inherited default, simply add a new default for that custom field at the current mapping level.

If a custom field default is set to apply only on comment, a default for the same custom field on the parent mapping level on create will still be inherited. The same behaviour applies in the opposite scenario.