java.lang.Object
   ↳ com.atlassian.jira.issue.fields.AbstractField
     ↳ com.atlassian.jira.issue.fields.AbstractOrderableField<V>
       ↳ com.atlassian.jira.issue.fields.IssueLinksSystemField

Summary

Nested Classes
interface IssueLinksSystemField.IssueLinkingValue This interface is used as a value object for IssueLinking information. 
Constants
String PARAMS_ISCREATEISSUE
String PARAMS_ISSUE_KEYS
String PARAMS_LINK_TYPE
[Expand]
Inherited Constants
From interface com.atlassian.jira.issue.fields.NavigableField
From interface com.atlassian.jira.issue.fields.OrderableField
[Expand]
Inherited Fields
From class com.atlassian.jira.issue.fields.AbstractField
Public Constructors
IssueLinksSystemField(VelocityTemplatingEngine templatingEngine, ApplicationProperties applicationProperties, JiraAuthenticationContext authenticationContext, PermissionManager permissionManager, IssueLinkService issueLinkService, UserHistoryManager userHistoryManager, IssueLinkManager issueLinkManager, IssueLinksBeanBuilderFactory issueLinkBeanBuilderFactory, I18nHelper.BeanFactory i18nFactory, IssueLinkTypeFinder issueLinkTypeFinder, JiraBaseUrls jiraBaseUrls)
Public Methods
String availableForBulkEdit(BulkEditBean bulkEditBean)
boolean canRemoveValueFromIssueObject(Issue issue)
void createValue(Issue issue, IssueLinksSystemField.IssueLinkingValue value)
String getBulkEditHtml(OperationContext operationContext, Action action, BulkEditBean bulkEditBean, Map displayParameters)
Returns HTML that should be shown when the issue is being bulk edited.
String getColumnCssClass()
String getColumnHeadingKey()
String getColumnViewHtml(FieldLayoutItem fieldLayoutItem, Map displayParams, Issue issue)
String getCreateHtml(FieldLayoutItem fieldLayoutItem, OperationContext operationContext, Action action, Issue issue, Map displayParameters)
String getDefaultSortOrder()
The order in which to sort the field when it is sorted for the first time.
IssueLinksSystemField.IssueLinkingValue getDefaultValue(Issue issue)
String getEditHtml(FieldLayoutItem fieldLayoutItem, OperationContext operationContext, Action action, Issue issue, Map displayParameters)
FieldTypeInfo getFieldTypeInfo(FieldTypeInfoContext fieldTypeInfoContext)
Returns lower level Information about the field.
String getHiddenFieldId()
Returns the id of the field to check for visibility.
JsonData getJsonDefaultValue(IssueContext issueCtx)
Return The default data for this system field.
FieldJsonRepresentation getJsonFromIssue(Issue issue, boolean renderedVersionRequired, FieldLayoutItem fieldLayoutItem)
Return a FieldJsonDataPair containing a json representation of the raw data for this field, and if required, a json representation of the rendered data for easy display.
JsonType getJsonSchema()
Return a description of the shape of this field when represented as JSON.
RestFieldOperationsHandler getRestFieldOperation()
FieldComparatorSource getSortComparatorSource()
A sortComparatorSource object to be used for sorting columns in a table.
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.
IssueLinksSystemField.IssueLinkingValue getValueFromParams(Map fieldValueHolder)
This is called from BulkEdit/BulkWorkflowTransition to get an value object from a input set of values.
String getViewHtml(FieldLayoutItem fieldLayoutItem, Action action, Issue issue, Map displayParameters)
String getViewHtml(FieldLayoutItem fieldLayoutItem, Action action, Issue issue, IssueLinksSystemField.IssueLinkingValue value, Map displayParameters)
boolean hasValue(Issue issue)
boolean isShown(Issue issue)
MessagedResult needsMove(Collection originalIssues, Issue targetIssue, FieldLayoutItem targetFieldLayoutItem)
void populateDefaults(Map<StringObject> fieldValuesHolder, Issue issue)
We don't return any default for the field.
void populateForMove(Map<StringObject> fieldValuesHolder, Issue originalIssue, Issue targetIssue)
void populateFromIssue(Map<StringObject> fieldValuesHolder, Issue issue)
This is called to populate the field values holder with the current state of the Issue object.
void populateParamsFromString(Map<StringObject> fieldValuesHolder, String stringValue, Issue issue)
This was called by Jelly code to map a value into a field values holder.
String prettyPrintChangeHistory(String changeHistory, I18nHelper i18nHelper)
Used for email notification templates - allows changelog to be displayed in language of the recipient.
String prettyPrintChangeHistory(String changeHistory)
void removeValueFromIssueObject(MutableIssue issue)
void updateIssue(FieldLayoutItem fieldLayoutItem, MutableIssue issue, Map fieldValueHolder)
This is called to back update the MutableIssue with the value object we previously stuffed into the field values holder.
void updateValue(FieldLayoutItem fieldLayoutItem, Issue issue, ModifiedValue modifiedValue, IssueChangeHolder issueChangeHolder)
This is called after the issue has been stored on disk and allows us a chance to create change records for the update.
void validateParams(OperationContext operationContext, ErrorCollection errorCollection, I18nHelper i18n, Issue issue, FieldScreenRenderLayoutItem fieldScreenRenderLayoutItem)
Protected Methods
Object getRelevantParams(Map<StringString[]> inputParameters)
This is implemented in response to use being an AbstractOrderableField.
[Expand]
Inherited Methods
From class com.atlassian.jira.issue.fields.AbstractOrderableField
From class com.atlassian.jira.issue.fields.AbstractField
From class java.lang.Object
From interface com.atlassian.jira.issue.fields.Field
From interface com.atlassian.jira.issue.fields.NavigableField
From interface com.atlassian.jira.issue.fields.OrderableField
From interface com.atlassian.jira.issue.fields.SearchableField
From interface com.atlassian.jira.issue.fields.rest.RestAwareField
From interface com.atlassian.jira.issue.fields.rest.RestFieldOperations
From interface java.lang.Comparable

Constants

public static final String PARAMS_ISCREATEISSUE

Constant Value: "isCreateIssue"

public static final String PARAMS_ISSUE_KEYS

Constant Value: "issuelinks-issues"

public static final String PARAMS_LINK_TYPE

Constant Value: "issuelinks-linktype"

Public Constructors

public IssueLinksSystemField (VelocityTemplatingEngine templatingEngine, ApplicationProperties applicationProperties, JiraAuthenticationContext authenticationContext, PermissionManager permissionManager, IssueLinkService issueLinkService, UserHistoryManager userHistoryManager, IssueLinkManager issueLinkManager, IssueLinksBeanBuilderFactory issueLinkBeanBuilderFactory, I18nHelper.BeanFactory i18nFactory, IssueLinkTypeFinder issueLinkTypeFinder, JiraBaseUrls jiraBaseUrls)

Public Methods

public String availableForBulkEdit (BulkEditBean bulkEditBean)

public boolean canRemoveValueFromIssueObject (Issue issue)

public void createValue (Issue issue, IssueLinksSystemField.IssueLinkingValue value)

public String getBulkEditHtml (OperationContext operationContext, Action action, BulkEditBean bulkEditBean, Map displayParameters)

Returns HTML that should be shown when the issue is being bulk edited. By default calls the getEditHtml(com.atlassian.jira.issue.fields.layout.field.FieldLayoutItem, com.atlassian.jira.issue.customfields.OperationContext, webwork.action.Action, com.atlassian.jira.issue.Issue, java.util.Map) method with null for FieldLayoutItem and the first issue in the collection}

Parameters
operationContext OperationContext
action Action
bulkEditBean BulkEditBean
displayParameters Map of display parameters.
Returns
  • HTML that should be shown when the issue is being edited.

public String getColumnCssClass ()

public String getColumnHeadingKey ()

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

public String getCreateHtml (FieldLayoutItem fieldLayoutItem, OperationContext operationContext, Action action, Issue issue, Map displayParameters)

public String getDefaultSortOrder ()

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

Returns

public IssueLinksSystemField.IssueLinkingValue getDefaultValue (Issue issue)

public String getEditHtml (FieldLayoutItem fieldLayoutItem, OperationContext operationContext, Action action, Issue issue, Map displayParameters)

public FieldTypeInfo getFieldTypeInfo (FieldTypeInfoContext fieldTypeInfoContext)

Returns lower level Information about the field. This information contains allowed values and/or the autocomplete url

Parameters
fieldTypeInfoContext the FieldTypeInfoContext contains context information that is relevant to generate the FieldTypeInfo

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 JsonData getJsonDefaultValue (IssueContext issueCtx)

Return The default data for this system field. May be null if there is no default.

Parameters
issueCtx Issue (This should really only need to be an issue context, but for historical reasons we need an issue object.

public FieldJsonRepresentation getJsonFromIssue (Issue issue, boolean renderedVersionRequired, FieldLayoutItem fieldLayoutItem)

Return a FieldJsonDataPair containing a json representation of the raw data for this field, and if required, a json representation of the rendered data for easy display.

Parameters
issue to get field data from
renderedVersionRequired whether the use requested the return of rendered/pretty data as well as raw data
fieldLayoutItem field layout for this field. Will only be supplied if the field is also an ordereable field.
Returns
  • FieldJsonDataPair containing a json representation of the raw data for this field, and if required, a json representation of the rendered data for easy display.

public JsonType getJsonSchema ()

Return a description of the shape of this field when represented as JSON.

public RestFieldOperationsHandler getRestFieldOperation ()

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

public List<SortField> getSortFields (boolean sortOrder)

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 IssueLinksSystemField.IssueLinkingValue getValueFromParams (Map fieldValueHolder)

This is called from BulkEdit/BulkWorkflowTransition to get an value object from a input set of values.

Parameters
fieldValueHolder the map of parameters.
Returns
  • a parsed long or null if not in the input.

public String getViewHtml (FieldLayoutItem fieldLayoutItem, Action action, Issue issue, Map displayParameters)

public String getViewHtml (FieldLayoutItem fieldLayoutItem, Action action, Issue issue, IssueLinksSystemField.IssueLinkingValue value, Map displayParameters)

public boolean hasValue (Issue issue)

public boolean isShown (Issue issue)

public MessagedResult needsMove (Collection originalIssues, Issue targetIssue, FieldLayoutItem targetFieldLayoutItem)

public void populateDefaults (Map<StringObject> fieldValuesHolder, Issue issue)

We don't return any default for the field.

Parameters
fieldValuesHolder The fieldValuesHolder Map to be populated.
issue The issue in play.

public void populateForMove (Map<StringObject> fieldValuesHolder, Issue originalIssue, Issue targetIssue)

public void populateFromIssue (Map<StringObject> fieldValuesHolder, Issue issue)

This is called to populate the field values holder with the current state of the Issue object. For example this will be called when the issue is edited.

Parameters
fieldValuesHolder The fieldValuesHolder Map to be populated.
issue The issue in play.

public void populateParamsFromString (Map<StringObject> fieldValuesHolder, String stringValue, Issue issue)

This was called by Jelly code to map a value into a field values holder.

Parameters
fieldValuesHolder Map of field Values.
stringValue user friendly string value.
issue the issue in play.

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

public String prettyPrintChangeHistory (String changeHistory)

public void removeValueFromIssueObject (MutableIssue issue)

public void updateIssue (FieldLayoutItem fieldLayoutItem, MutableIssue issue, Map fieldValueHolder)

This is called to back update the MutableIssue with the value object we previously stuffed into the field values holder.

This is called prior to the issue being stored on disk.

Parameters
fieldLayoutItem FieldLayoutItem in play.
issue MutableIssue in play.
fieldValueHolder Field Value Holder Map.

public void updateValue (FieldLayoutItem fieldLayoutItem, Issue issue, ModifiedValue modifiedValue, IssueChangeHolder issueChangeHolder)

This is called after the issue has been stored on disk and allows us a chance to create change records for the update.

Parameters
fieldLayoutItem for this field within this context.
issue Issue this field is part of.
modifiedValue new value to set field to. Cannot be null.
issueChangeHolder an object to record any changes made to the issue by this method.

public void validateParams (OperationContext operationContext, ErrorCollection errorCollection, I18nHelper i18n, Issue issue, FieldScreenRenderLayoutItem fieldScreenRenderLayoutItem)

Protected Methods

protected Object getRelevantParams (Map<StringString[]> inputParameters)

This is implemented in response to use being an AbstractOrderableField. It is actually called via populateFromParams so that we can place our relevant value object into the field values holder map. See above for the code entry point.

Parameters
inputParameters the input parameters.
Returns
  • the object to be placed into a field values holder map under our id.