public class

AffectedVersionsSystemField

extends AbstractVersionsSystemField
implements AffectedVersionsField RestFieldOperations
java.lang.Object
   ↳ com.atlassian.jira.issue.fields.AbstractField
     ↳ com.atlassian.jira.issue.fields.AbstractOrderableField<V>
       ↳ com.atlassian.jira.issue.fields.AbstractOrderableNavigableFieldImpl<V>
         ↳ com.atlassian.jira.issue.fields.AbstractVersionsSystemField
           ↳ com.atlassian.jira.issue.fields.AffectedVersionsSystemField

Class Overview

Copyright (c) 2002-2004 All rights reserved.

Summary

Constants
String CHANGE_ITEM_FIELD
[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.AbstractVersionsSystemField
From class com.atlassian.jira.issue.fields.AbstractField
Public Constructors
AffectedVersionsSystemField(VelocityTemplatingEngine templatingEngine, ApplicationProperties applicationProperties, VersionManager versionManager, PermissionManager permissionManager, JiraAuthenticationContext authenticationContext, RaisedInVersionStatisticsMapper raisedInVersionStatsMapper, VersionHelperBean versionHelperBean, AffectedVersionSearchHandlerFactory searchHandlerFactory, JiraBaseUrls jiraBaseUrls, SearchLinkGenerator searchLinkGenerator, EventPublisher eventPublisher)
Public Methods
boolean canRemoveValueFromIssueObject(Issue issue)
Returns true if a call to removeValueFromIssueObject(com.atlassian.jira.issue.MutableIssue) will actually remove the value.
String getColumnHeadingKey()
Collection<Version> getDefaultValue(Issue issue)
JsonData getJsonDefaultValue(IssueContext issueCtx)
Return The default data for this system field.
RestFieldOperationsHandler getRestFieldOperation()
LuceneFieldSorter getSorter()
A sorter to be used when sorting columns in a table.
boolean isShown(Issue issue)
Tests field specific way to determine if it should be shown or not.
void removeValueFromIssueObject(MutableIssue issue)
Removes the field value from the given MutableIssue object.
void updateIssue(FieldLayoutItem fieldLayoutItem, MutableIssue issue, Map fieldValueHolder)
Record the value on the issue (not saving it to the database, see updateValue).
Protected Methods
void addFieldRequiredErrorMessage(Issue issue, ErrorCollection errorCollection, I18nHelper i18n)
String getArchivedVersionsFieldSearchParam()
String getArchivedVersionsFieldTitle()
String getChangeItemFieldName()
Collection<Version> getCurrentVersions(Issue issue)
String getIssueRelationName()
String getModifiedWithoutPermissionErrorMessage(I18nHelper i18n)
boolean getUnreleasedVersionsFirst()
List<ChangeItemBean> updateIssueValue(Issue issue, Collection<Version> newValue)
[Expand]
Inherited Methods
From class com.atlassian.jira.issue.fields.AbstractVersionsSystemField
From class com.atlassian.jira.issue.fields.AbstractOrderableNavigableFieldImpl
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 CHANGE_ITEM_FIELD

Constant Value: "Version"

Public Constructors

public AffectedVersionsSystemField (VelocityTemplatingEngine templatingEngine, ApplicationProperties applicationProperties, VersionManager versionManager, PermissionManager permissionManager, JiraAuthenticationContext authenticationContext, RaisedInVersionStatisticsMapper raisedInVersionStatsMapper, VersionHelperBean versionHelperBean, AffectedVersionSearchHandlerFactory searchHandlerFactory, JiraBaseUrls jiraBaseUrls, SearchLinkGenerator searchLinkGenerator, EventPublisher eventPublisher)

Public Methods

public boolean canRemoveValueFromIssueObject (Issue issue)

Returns true if a call to removeValueFromIssueObject(com.atlassian.jira.issue.MutableIssue) will actually remove the value.

There a few different reasons why this method may return false:

  • The OrderableField can sometimes remove the value, but it decides that it is not relevant for this Issue. eg: Security Level will ignore remove requests on a subtask, as the subtask Security is not set explicitly (it is always inherited from its parent issue).
  • It may possible to remove this value, but the OrderableField does not actually do the job, it is done through some special mechanism. eg Attachments.
  • This field is some special system field which it is invalid to remove. eg Project. In these cases calling removeValueFromIssueObject() would normally raise an UnsupportedOperationException.
In general it is safe to call removeValueFromIssueObject() even if this method returns false, as the request will be silently ignored. However there are a couple of special fields where calling removeValueFromIssueObject() will throw an UnsupportedOperationException - eg if you try to remove the Project.

Parameters
issue The Issue object.
Returns

public String getColumnHeadingKey ()

public Collection<Version> getDefaultValue (Issue issue)

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 RestFieldOperationsHandler getRestFieldOperation ()

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 boolean isShown (Issue issue)

Tests field specific way to determine if it should be shown or not.

Parameters
issue The Issue.
Returns
  • true if it should be shown.

public void removeValueFromIssueObject (MutableIssue issue)

Removes the field value from the given MutableIssue object.

Note that this operation does not actually persist the change, it just clears the value from the given Issue object. The caller will still need to call #updateValue() in order to persist the change.

Some Fields may choose to quietly ignore this request. eg The SecurityLevel Field will not remove Security Level from subtasks because the subtask must always take the Security Level of its parent issue.

Parameters
issue The issue object to be effected.

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

Record the value on the issue (not saving it to the database, see updateValue).

Parameters
fieldLayoutItem FieldLayoutItem
issue MutableIssue
fieldValueHolder Field Value Holder Map

Protected Methods

protected void addFieldRequiredErrorMessage (Issue issue, ErrorCollection errorCollection, I18nHelper i18n)

protected String getArchivedVersionsFieldSearchParam ()

protected String getArchivedVersionsFieldTitle ()

protected String getChangeItemFieldName ()

protected Collection<Version> getCurrentVersions (Issue issue)

protected String getIssueRelationName ()

protected String getModifiedWithoutPermissionErrorMessage (I18nHelper i18n)

protected boolean getUnreleasedVersionsFirst ()

protected List<ChangeItemBean> updateIssueValue (Issue issue, Collection<Version> newValue)