Chapter 3. Advanced Custom Field Types

Overview

This chapter describes some more advanced aspects of custom field plugins, including configuration and fields that contain multiple values. The first example in this chapter builds on the simpler example introduced in Chapter 2. The source code for all the examples in this chapter is available at https://marketplace.atlassian.com/41293.

Adding Configuration to a Custom Field

Different types of custom fields are configured differently. For example, many custom fields can have a default value configured. Select List custom fields can have their options (choices) configured. This section shows how to configure the Currency custom field type of Chapter 2 to display its value in a specific currency such as Euro (€) or Pound (£). The actual value stored in the field is unchanged, but what is seen in the field in an issue should change according to the chosen type of currency.

JIRA also allows different contexts to be configured for each custom field. This is how you can have different sets of options for a Select List in different projects and issue types. The custom field configuration described here also supports choosing different currencies for different custom field contexts.

Caution

JIRA also allows you to have many custom fields all with the same type and same name, since it uses a unique custom field id internally for each field. However this is usually too confusing in practice, so I don’t recommend it. Use contexts instead.

The first ...

Get Practical JIRA Plugins now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.