@PublicApi public interface

NavigableField

implements Field
com.atlassian.jira.issue.fields.NavigableField
Known Indirect Subclasses

@PublicApi

This interface is designed for plugins to consume (call its methods).

Clients of @PublicApi can expect that programs compiled against a given version will remain binary compatible with later versions of the @PublicApi as per each product's API policy as long as the client does not implement/extend @PublicApi interfaces or classes (refer to each product's API policy for the exact guarantee---usually binary compatibility is guaranteed at least across minor versions).

Note: since @PublicApi interfaces and classes are not designed to be implemented or extended by clients, we may perform certain types of binary-incompatible changes to these classes and interfaces, but these will not affect well-behaved clients that do not extend/implement these types (in general, only classes and interfaces annotated with @PublicSpi are safe to extend/implement).

Class Overview

Fields in JIRA which are able to be placed in the Issue Navigator implement this interface.

Summary

Constants
String ORDER_ASCENDING
String ORDER_DESCENDING
String TEMPLATE_DIRECTORY_PATH
Public Methods
String getColumnCssClass()
String getColumnHeadingKey()
String getColumnViewHtml(FieldLayoutItem fieldLayoutItem, Map<StringObject> displayParams, Issue issue)
String getDefaultSortOrder()
The order in which to sort the field when it is sorted for the first time.
String getHiddenFieldId()
Returns the id of the field to check for visibility.
FieldComparatorSource getSortComparatorSource()
A sortComparatorSource object to be used for sorting columns in a table.
@Internal List<SortField> getSortFields(boolean sortOrder)
Return a list of Lucene SortFields to be used for sorting search results.
LuceneFieldSorter getSorter()
A sorter to be used when sorting columns in a table.
String prettyPrintChangeHistory(String changeHistory)
String prettyPrintChangeHistory(String changeHistory, I18nHelper i18nHelper)
Used for email notification templates - allows changelog to be displayed in language of the recipient.
[Expand]
Inherited Methods
From interface com.atlassian.jira.issue.fields.Field
From interface java.lang.Comparable

Constants

public static final String ORDER_ASCENDING

Constant Value: "ASC"

public static final String ORDER_DESCENDING

Constant Value: "DESC"

public static final String TEMPLATE_DIRECTORY_PATH

Constant Value: "templates/jira/issue/field/"

Public Methods

public String getColumnCssClass ()

public String getColumnHeadingKey ()

public String getColumnViewHtml (FieldLayoutItem fieldLayoutItem, Map<StringObject> displayParams, Issue issue)

public String getDefaultSortOrder ()

The order in which to sort the field when it is sorted for the first time.

Returns

public String getHiddenFieldId ()

Returns the id of the field to check for visibility. For example, with original estimate field need to ensure that the timetracking field is not hidden. With most fields, this is the same as their id.

public FieldComparatorSource getSortComparatorSource ()

A sortComparatorSource object to be used for sorting columns in a table. In most cases this will use a MappedSortComparator using the getSorter() method. However, fields can provide any sorting mechanism that they wish.

If a field can be sorted directly using terms in the Lucene index then the field should implement getSortFields(boolean) rather than this method.

In large installations custom sorting may incur a maor performance penalty.

Returns
  • A SortComparatorSource that can be used to sort, or null if this field does not use custom sorting

@Internal public List<SortField> getSortFields (boolean sortOrder)

@Internal

This method is an internal implementation detail and will change without notice.

Clients that depend on @Internal classes and interfaces can not expect to be compatible with any version other than the version they were compiled against (even minor version and milestone releases may break binary compatibility with respect to @Internal elements).

Return a list of Lucene SortFields to be used for sorting search results.

Using this method allows the field to specify the most performant way to perform a search. If a field can be sorted directly using the term in the index then this should just return a singleton list with the sort field.

return Collections.singletonList(new SortField(fieldName, sortOrder));

The default implementation builds this using the FieldComparatorSource returned by getSortComparatorSource()

If you implement this method there is no need to implement getSortComparatorSource().

Returns
  • The name of the indexed term to be used for native Lucene sorting.

public LuceneFieldSorter getSorter ()

A sorter to be used when sorting columns in a table. This sort uses the Lucene Document Collection and is therefore a lot faster than sorting the issues in memory.

Returns

public String prettyPrintChangeHistory (String changeHistory)

public String prettyPrintChangeHistory (String changeHistory, I18nHelper i18nHelper)

Used for email notification templates - allows changelog to be displayed in language of the recipient.

Returns
  • String change history formatted according to locale in i18nHelper