Making custom fields sortable

We have seen the creation of new custom fields, writing new searchers for them, and so on. Another important feature with the fields, be it custom fields or the standard JIRA fields, is to use them for sorting. But simply writing a new custom field type won't enable sorting on that field.

In this recipe, we will see how to enable sorting on custom fields.

Getting ready

Create the new custom field type that we need to enable searching for.

How to do it...

This is easy to do. There are only two simple steps that you need to do to make sure the custom field is a sortable field:

  1. Implement the SortableCustomField interface. A new custom field type will look like the following:
            public class DemoCFType extends AbstractCustomFieldType ...

Get JIRA Development Cookbook - Third Edition 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.