Class MockCustomField
- All Implemented Interfaces:
ConfigurableField<Object>,CustomField,DefaultValueField<Object>,Field,HideableField,NavigableField,OrderableField<Object>,RenderableField,RequirableField,RestAwareField,RestFieldOperations,SearchableField,Comparable
CustomField for.- Since:
- v4.1
-
Field Summary
Fields inherited from interface com.atlassian.jira.issue.fields.CustomField
ENTITY_CF_TYPE_KEY, ENTITY_CUSTOM_FIELD_SEARCHER, ENTITY_DESCRIPTION, ENTITY_ID, ENTITY_ISSUES_WITH_VALUE, ENTITY_ISSUETYPE, ENTITY_LAST_VALUE_UPDATE, ENTITY_NAME, ENTITY_PROJECT, ENTITY_TABLE_NAMEFields inherited from interface com.atlassian.jira.issue.fields.NavigableField
ORDER_ASCENDING, ORDER_DESCENDING, TEMPLATE_DIRECTORY_PATHFields inherited from interface com.atlassian.jira.issue.fields.OrderableField
MOVE_ISSUE_PARAM_KEY, NO_HEADER_PARAM_KEY, TEMPLATE_DIRECTORY_PATH -
Constructor Summary
ConstructorsConstructorDescriptionMockCustomField(String id, String name, CustomFieldType customFieldType) MockCustomField(String id, String name, CustomFieldType customFieldType, String description) MockCustomField(String id, String name, CustomFieldType customFieldType, String description, Timestamp lastValueUpdate, Long issuesWithValue) -
Method Summary
Modifier and TypeMethodDescriptionavailableForBulkEdit(BulkEditBean bulkEditBean) Determines whether the field is available for bulk editing given the BulkEditBean.booleanReturnstrueif a call toOrderableField.removeValueFromIssueObject(com.atlassian.jira.issue.MutableIssue)will actually remove the value.intThis method compares the values of this custom field in two given issues.intReturnSearchHandlerfor the field.voidcreateValue(Issue issue, Object value) Create the value of the issue in the data store.Returns a list ofIssueTypes directly associated with thisCustomField.Returns a list ofProjects directly associated with thisCustomField.getBulkEditHtml(OperationContext operationContext, webwork.action.Action action, BulkEditBean bulkEditBean, Map displayParameters) Returns HTML that should be shown when the issue is being bulk edited.Return the JQL clause names that this custom field should be recognized by.getColumnViewHtml(FieldLayoutItem fieldLayoutItem, Map displayParams, Issue issue) Returns a List ofFieldConfigItemTypeobjects.Returns a list of configuration schemes.getCreateHtml(FieldLayoutItem fieldLayoutItem, OperationContext operationContext, webwork.action.Action action, Issue issue) Returns the HTML that should be shown when the issue is being created.getCreateHtml(FieldLayoutItem fieldLayoutItem, OperationContext operationContext, webwork.action.Action action, Issue issue, Map displayParameters) Returns the HTML that should be shown when the issue is being created.Retrieves theCustomFieldSearcherfor this custom field.Looks up theCustomFieldType.getCustomFieldValues(Map customFieldValuesHolder) Get the custom field string values that are relevant to this particular custom fieldThe order in which to sort the field when it is sorted for the first time.getDefaultValue(Issue issue) The value that should be set on the issue if the field is not shown for some reason.Returns the 1i8n'ed description of this custom field.Returns aRenderablePropertyfor rendering this custom field's description.getEditHtml(FieldLayoutItem fieldLayoutItem, OperationContext operationContext, webwork.action.Action action, Issue issue) Returns HTML that should be shown when the issue is being edited.getEditHtml(FieldLayoutItem fieldLayoutItem, OperationContext operationContext, webwork.action.Action action, Issue issue, Map displayParameters) Returns HTML that should be shown when the issue is being edited.Returns the title of this custom field.getFieldTypeInfo(FieldTypeInfoContext fieldTypeInfoContext) Returns lower level Information about the field.org.ofbiz.core.entity.GenericValueReturns a generic value that represents this custom fieldReturns the id of the field to check for visibility.getId()The unique id of the fieldReturns ID of this custom field.Returns number of issues containing at least one non empty value for the custom field.getJsonDefaultValue(IssueContext issueCtx) Return The default data for this system field.getJsonFromIssue(Issue issue, boolean renderedVersionRequested, 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.Return a description of the shape of this field when represented as JSON.Returns the latest date of either: - creation date of an issue with a non default value of the custom field - issue update date when value of the custom field has been changedgetName()Returns i18n'ed name of the field.The i18n key that is used to lookup the field's name when it is displayedgetOptions(FieldConfig config) Returns options for this custom field if it is ofMultipleCustomFieldTypetype.getOptions(String key, JiraContextNode jiraContextNode) Returns options for this custom field if it is ofMultipleCustomFieldTypetype.getOptions(String key, FieldConfig config, JiraContextNode contextNode) Returns options for this custom field if it is ofMultipleCustomFieldTypetype.com.opensymphony.module.propertyset.PropertySetgetRelevantConfig(IssueContext issueContext) Returns the relevant field config of this custom field for the give issue contextgetRelevantConfig(Issue issue) Returns a relevantFieldConfigfor the given issue.getReleventConfig(SearchContext searchContext) TheFieldConfigthat is relevent to all issue contexts in the search context Checks that all configs within search context are the same - i.e.org.apache.lucene.search.FieldComparatorSourceA sortComparatorSource object to be used for sorting columns in a table.A sorter to be used when sorting columns in a table.List<org.apache.lucene.search.SortField>getSortFields(boolean sortOrder) Return a list of Lucene SortFields to be used for sorting search results.Returns the description of this custom field by readingCustomField.ENTITY_DESCRIPTIONof the underlying generic value.Returns aRenderablePropertyfor rendering this custom field's untranslated description, for admin.Returns the name of this custom field by readingCustomField.ENTITY_NAMEof the underlying generic value.Retrieves and returns the Object representing the this CustomField value for the given issue.getValueFromIssue(Issue issue) Gets the value stored for this field on the provided issue.getValueFromParams(Map params) Get a field value from the map of parameters passed.getViewHtml(FieldLayoutItem fieldLayoutItem, webwork.action.Action action, Issue issue) getViewHtml(FieldLayoutItem fieldLayoutItem, webwork.action.Action action, Issue issue, Object value, Map displayParameters) getViewHtml(FieldLayoutItem fieldLayoutItem, webwork.action.Action action, Issue issue, Map displayParameters) booleanChecks to see if the (web) parameters contains a relevant value with which to populate the issuebooleanDetermines if the field has a value for the given issue.booleanReturns true if it applies for all issue types, false otherwise.booleanChecks whether this custom field applies for all projects.booleanReturns true if this custom field can be edited, false otherwise.booleanReturns true if any configuration scheme returned byCustomField.getConfigurationSchemes()is enabled.booleanisGlobal()Returns true if this custom field applies for all projects and all issue types.booleanDetermines if this custom field is within the scope of the given project, and Issue Type.booleanisInScope(SearchContext searchContext) Determines whether this custom field is in scope.booleanDetermines if this custom field is within the scope of the given project, and list of Issue Types.booleanisInScopeForSearch(Project project, List<String> issueTypeIds) Determines if this custom field is within the scope of the given project, and list of Issue Types.booleanisRelevantForIssueContext(IssueContext issueContext) Returns true if the custom field has a config for the Project and Issue Type of the given IssueContext.booleanDefines if a field determines itself as renderable.booleanTests field specific way to determine if it should be shown or not.needsMove(Collection originalIssues, Issue targetIssue, FieldLayoutItem targetFieldLayoutItem) Used to determine if the field needs input from user to be moved to the new project and/or issue type.voidpopulateDefaults(Map fieldValuesHolder, Issue issue) Populate the fieldValueHolder with a value that should be shown by default when the issue has not been created yet.voidUsed to populate the fieldValueHolder with parameters for move issue screen.voidpopulateFromIssue(Map fieldValuesHolder, Issue issue) Used to initialise the fieldValuesHolder from the current value of teh issue.voidpopulateFromParams(Map fieldValuesHolder, Map parameters) Populate the fieldValuesHolder with a value from (web) parameters.voidpopulateParamsFromString(Map fieldValuesHolder, String stringValue, Issue issue) Used to convert from a user friendly string value and put the result into the fieldValuesHolder.prettyPrintChangeHistory(String changeHistory) prettyPrintChangeHistory(String changeHistory, I18nHelper i18nHelper) Used for email notification templates - allows changelog to be displayed in language of the recipient.remove()Removes this custom field and returns a set of issue IDs of all issues that are affected by removal of this custom field.voidRemoves the field value from the given MutableIssue object.setAssociatedIssueTypes(List<IssueType> issueTypes) setAssociatedProjectObjects(List<Project> projectObjects) voidsetDescription(String description) setGlobal(boolean isGlobal) setIsAllIssueTypes(boolean isAllIssueTypes) setIsAllProjects(boolean isAllProjects) setSearcher(CustomFieldSearcher searcher) toString()voidupdateIssue(FieldLayoutItem fieldLayoutItem, MutableIssue issue, Map fieldValueHolder) Record the value on the issue (not saving it to the database, see updateValue).voidupdateValue(FieldLayoutItem fieldLayoutItem, Issue issue, ModifiedValue modifiedValue, IssueChangeHolder issueChangeHolder) Update the issue in the data store.voidvalidateFromActionParams(Map actionParameters, ErrorCollection errorCollection, FieldConfig config) Validates relevant parameters on custom field type of this custom field.voidvalidateParams(OperationContext operationContext, ErrorCollection errorCollectionToAddTo, I18nHelper i18n, Issue issue, FieldScreenRenderLayoutItem fieldScreenRenderLayoutItem) Ensure that the parameters are validMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.atlassian.jira.issue.fields.CustomField
getOptionsMethods inherited from interface com.atlassian.jira.issue.fields.NavigableField
getFieldSorts, getValueLoader, hasSortsDefined, prettyPrintChangeHistory
-
Constructor Details
-
MockCustomField
public MockCustomField() -
MockCustomField
-
MockCustomField
-
MockCustomField
-
-
Method Details
-
isInScope
Description copied from interface:CustomFieldDetermines if this custom field is within the scope of the given project, and list of Issue Types.- Specified by:
isInScopein interfaceCustomField- Parameters:
project- The project.issueTypeIds- A list of IssueType ids.- Returns:
trueif this custom field is within the given scope.
-
isInScope
Description copied from interface:CustomFieldDetermines if this custom field is within the scope of the given project, and Issue Type.- Specified by:
isInScopein interfaceCustomField- Parameters:
projectId- The project.issueTypeId- The issueTypeId- Returns:
trueif this custom field is within the given scope.- See Also:
-
isInScopeForSearch
Description copied from interface:CustomFieldDetermines if this custom field is within the scope of the given project, and list of Issue Types.If the project is null, then it is treated as any project. If the issueTypeIds list is null or an empty list, then it is treated as any issue type.
If the passed project is any project, this method will search in all the
FieldConfigSchemeof this custom field, ignoring the projects that they apply to (since the given project is any) and looking for at least one of them that applies to at least one of the given issue type ids.If the passed list of issue types is any issue type, this method will search for at least one
FieldConfigSchemethat applies to the given project, ignoring the issue types that it applies to (since the given issue type ids are any).If both the project and issue types are any, the question being asked is "is this custom field in the scope of any project and any issue type?", which will always be true.
- Specified by:
isInScopeForSearchin interfaceCustomField
-
isInScope
Description copied from interface:CustomFieldDetermines whether this custom field is in scope.- Specified by:
isInScopein interfaceCustomField- Parameters:
searchContext- search context- Returns:
- true if this field is in scope
-
getGenericValue
public org.ofbiz.core.entity.GenericValue getGenericValue()Description copied from interface:CustomFieldReturns a generic value that represents this custom field- Specified by:
getGenericValuein interfaceCustomField- Returns:
- generic value of this custom field
-
compare
Description copied from interface:CustomFieldThis method compares the values of this custom field in two given issues.Returns a negative integer, zero, or a positive integer as the value of first issue is less than, equal to, or greater than the value of the second issue.
If either of given issues is null a IllegalArgumentException is thrown.
- Specified by:
comparein interfaceCustomField- Parameters:
issue1- issue to compareissue2- issue to compare- Returns:
- a negative integer, zero, or a positive integer as the value of first issue is less than, equal to, or greater than the value of the second issue
- Throws:
IllegalArgumentException- if any of given issues is null
-
getCustomFieldValues
Description copied from interface:CustomFieldGet the custom field string values that are relevant to this particular custom field- Specified by:
getCustomFieldValuesin interfaceCustomField- Parameters:
customFieldValuesHolder- containing all params- Returns:
- a
CustomFieldParamsofStringobjects
-
getValue
Description copied from interface:CustomFieldRetrieves and returns the Object representing the this CustomField value for the given issue. SeeCustomFieldType.getValueFromIssue(CustomField, Issue). This is only used to communicate with the 'view' JSP. Multiselects will return a list, dates a date, etc.- Specified by:
getValuein interfaceCustomField- Parameters:
issue- issue to retrieve the value from- Returns:
- Object representing the this CustomField value for the given issue
- See Also:
-
remove
Description copied from interface:CustomFieldRemoves this custom field and returns a set of issue IDs of all issues that are affected by removal of this custom field.- Specified by:
removein interfaceCustomField- Returns:
- a set of issue IDs of affected issues
-
getOptions
Description copied from interface:CustomFieldReturns options for this custom field if it is ofMultipleCustomFieldTypetype. Otherwise, returns null.As this is just used by the view layer, it can be a list of objects
- Specified by:
getOptionsin interfaceCustomField- Parameters:
key- not usedjiraContextNode- Jira's context node - used to retrieve the relevant config- Returns:
- options for this custom field if it is of
MultipleCustomFieldTypetype, null otherwise
-
setDescription
-
getDescription
Description copied from interface:CustomFieldReturns the 1i8n'ed description of this custom field. To render views for the custom field description, preferCustomField.getDescriptionProperty().- Specified by:
getDescriptionin interfaceCustomField- Returns:
- the description of this custom field
-
getDescriptionProperty
Description copied from interface:CustomFieldReturns aRenderablePropertyfor rendering this custom field's description.- Specified by:
getDescriptionPropertyin interfaceCustomField- Returns:
- a read-only RenderableProperty
-
getCustomFieldSearcher
Description copied from interface:CustomFieldRetrieves theCustomFieldSearcherfor this custom field. The searcher, if found is initialized with this custom field before it is returned.- Specified by:
getCustomFieldSearcherin interfaceCustomField- Returns:
- found custom field searcher or null, if none found
-
setSearcher
-
isEditable
public boolean isEditable()Description copied from interface:CustomFieldReturns true if this custom field can be edited, false otherwise.- Specified by:
isEditablein interfaceCustomField- Returns:
- true if this custom field can be edited, false otherwise
-
getIdAsLong
Description copied from interface:CustomFieldReturns ID of this custom field.- Specified by:
getIdAsLongin interfaceCustomField- Returns:
- ID of this custom field
-
getLastValueUpdate
Description copied from interface:CustomFieldReturns the latest date of either: - creation date of an issue with a non default value of the custom field - issue update date when value of the custom field has been changed- Specified by:
getLastValueUpdatein interfaceCustomField- Returns:
- last update of the custom field
-
getIssuesWithValue
Description copied from interface:CustomFieldReturns number of issues containing at least one non empty value for the custom field.- Specified by:
getIssuesWithValuein interfaceCustomField- Returns:
- number of issues with the non empty custom field
-
getConfigurationSchemes
Description copied from interface:CustomFieldReturns a list of configuration schemes.- Specified by:
getConfigurationSchemesin interfaceCustomField- Returns:
- a list of
FieldConfigSchemeobjects.
-
getOptions
Description copied from interface:CustomFieldReturns options for this custom field if it is ofMultipleCustomFieldTypetype. Otherwise returns null.As this is just used by the view layer, it can be a list of objects
- Specified by:
getOptionsin interfaceCustomField- Parameters:
key- not usedconfig- relevant field configcontextNode- JIRA context node- Returns:
- options for this custom field if it is of
MultipleCustomFieldTypetype, null otherwise
-
getOptions
Description copied from interface:CustomFieldReturns options for this custom field if it is ofMultipleCustomFieldTypetype. Null otherwise.As this is just used by the view layer, it can be a list of objects
- Specified by:
getOptionsin interfaceCustomField- Parameters:
config- relevant field config- Returns:
- options for this custom field if it is of
MultipleCustomFieldTypetype, null otherwise
-
getRelevantConfig
Description copied from interface:CustomFieldReturns a relevantFieldConfigfor the given issue. If the field has a config for the issue then one will be returned, otherwise null is returned.For example, if we have 2 projects: project A and project B, and a custom field is configured to be only applicable to project A, calling getRelevantConfig with an issue from project A should return the config (i.e. not null). Calling this method with an issue from project B should return null.
- Specified by:
getRelevantConfigin interfaceCustomField- Parameters:
issue- issue whose project and issue type will be used to check if the field has a config- Returns:
- an instance of
FieldConfigrepresenting the configuration of the field for issue's project/issue type. If the field does not have a config for issue's project/issue type, null is returned. - See Also:
-
validateFromActionParams
public void validateFromActionParams(Map actionParameters, ErrorCollection errorCollection, FieldConfig config) Description copied from interface:CustomFieldValidates relevant parameters on custom field type of this custom field. Any errors found are added to the given errorCollection. SeeCustomFieldType.validateFromParams(CustomFieldParams, ErrorCollection, FieldConfig)- Specified by:
validateFromActionParamsin interfaceCustomField- Parameters:
actionParameters- action parameterserrorCollection- error collection to add errors toconfig- field config
-
getDefaultValueOperations
- Specified by:
getDefaultValueOperationsin interfaceDefaultValueField<Object>
-
getConfigurationItemTypes
Description copied from interface:ConfigurableFieldReturns a List ofFieldConfigItemTypeobjects. This opens up possibilties for configurable custom fields- Specified by:
getConfigurationItemTypesin interfaceConfigurableField<Object>- Returns:
- List of
FieldConfigItemType@Nonnull
-
getAssociatedProjectObjects
Description copied from interface:CustomFieldReturns a list ofProjects directly associated with thisCustomField.This method can return an empty result when the
CustomFieldis associated with allProjects. Please useCustomField.isAllProjects()prior to this method to detect this."- Specified by:
getAssociatedProjectObjectsin interfaceConfigurableField<Object>- Specified by:
getAssociatedProjectObjectsin interfaceCustomField- Returns:
- a list of
Projects directly associated with thisCustomField.
-
getAssociatedIssueTypes
Description copied from interface:CustomFieldReturns a list ofIssueTypes directly associated with thisCustomField.In case when this
CustomFieldCustomField.isAllIssueTypes()it will be associated with allIssueTypes but this method can still return empty result.- Specified by:
getAssociatedIssueTypesin interfaceCustomField- Returns:
- a list of
IssueTypes directly associated with thisCustomField.
-
getAssociatedIssueTypeObjects
- Specified by:
getAssociatedIssueTypeObjectsin interfaceCustomField- See Also:
-
isGlobal
public boolean isGlobal()Description copied from interface:CustomFieldReturns true if this custom field applies for all projects and all issue types.- Specified by:
isGlobalin interfaceCustomField- Returns:
- true if it is in all projects and all issue types, false otherwise.
-
isAllProjects
public boolean isAllProjects()Description copied from interface:CustomFieldChecks whether this custom field applies for all projects. It returns true if it applies for all projects for any field configuration scheme, false otherwise.- Specified by:
isAllProjectsin interfaceCustomField- Returns:
- true if it applies for all projects for any field configuration scheme, false otherwise.
-
isAllIssueTypes
public boolean isAllIssueTypes()Description copied from interface:CustomFieldReturns true if it applies for all issue types, false otherwise.- Specified by:
isAllIssueTypesin interfaceCustomField- Returns:
- true if it applies for all issue types, false otherwise.
-
isEnabled
public boolean isEnabled()Description copied from interface:CustomFieldReturns true if any configuration scheme returned byCustomField.getConfigurationSchemes()is enabled.- Specified by:
isEnabledin interfaceCustomField- Returns:
- true if any configuration scheme is enabled, false otherwise
-
getCustomFieldType
Description copied from interface:CustomFieldLooks up theCustomFieldType. It can return null if the custom field type cannot be found in theCustomFieldManager.- Specified by:
getCustomFieldTypein interfaceCustomField- Returns:
- custom field type
-
setCustomFieldType
-
createCustomFieldType
-
setGlobal
-
setAssociatedIssueTypes
-
setIsAllIssueTypes
-
setIsAllProjects
-
setAssociatedProjectObjects
-
isRelevantForIssueContext
Description copied from interface:CustomFieldReturns true if the custom field has a config for the Project and Issue Type of the given IssueContext.This is equivalent to calling
getRelevantConfig(issueContext) != null
but in general can run faster because it does not have to resolve the actual FieldConfig.- Specified by:
isRelevantForIssueContextin interfaceCustomField- Parameters:
issueContext- IssueContext whose project and issue type will be used to check if the field has a config- Returns:
- an instance of
FieldConfigrepresenting the configuration of the field for issue's project/issue type. If the field does not have a config for issue's project/issue type, null is returned. - See Also:
-
getRelevantConfig
Description copied from interface:CustomFieldReturns the relevant field config of this custom field for the give issue context- Specified by:
getRelevantConfigin interfaceConfigurableField<Object>- Specified by:
getRelevantConfigin interfaceCustomField- Parameters:
issueContext- issue context to find the relevant field config for- Returns:
- the relevant field config of this custom field for the give issue context
- See Also:
-
getReleventConfig
Description copied from interface:CustomFieldTheFieldConfigthat is relevent to all issue contexts in the search context Checks that all configs within search context are the same - i.e. all null or all the same config.Returns null if any two configs are different.
Note: null config is not equal to non-null config. Previously, a non-null config was returned even if the first config(s) was null.
- Specified by:
getReleventConfigin interfaceCustomField- Parameters:
searchContext- search context- Returns:
- null if any two configs are different
-
getClauseNames
Description copied from interface:CustomFieldReturn the JQL clause names that this custom field should be recognized by.- Specified by:
getClauseNamesin interfaceCustomField- Returns:
- the clause names this custom field should be recognized by.
-
getColumnHeadingKey
- Specified by:
getColumnHeadingKeyin interfaceNavigableField
-
getColumnCssClass
- Specified by:
getColumnCssClassin interfaceNavigableField
-
getDefaultSortOrder
Description copied from interface:NavigableFieldThe order in which to sort the field when it is sorted for the first time.- Specified by:
getDefaultSortOrderin interfaceNavigableField- Returns:
- Either
NavigableField.ORDER_ASCENDINGorNavigableField.ORDER_DESCENDING
-
getSortComparatorSource
public org.apache.lucene.search.FieldComparatorSource getSortComparatorSource()Description copied from interface:NavigableFieldA sortComparatorSource object to be used for sorting columns in a table. In most cases this will use aMappedSortComparatorusing theNavigableField.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
NavigableField.getSortFields(boolean sortOrder)rather than this method.In large installations custom sorting may incur a major performance penalty.
- Specified by:
getSortComparatorSourcein interfaceNavigableField- Returns:
- A SortComparatorSource that can be used to sort, or null if this field does not use custom sorting
-
getSorter
Description copied from interface:NavigableFieldA 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.- Specified by:
getSorterin interfaceNavigableField- Returns:
- A sorter that can be used to sort this field, or null depending on the value of
NavigableField.getSortComparatorSource() - See Also:
-
getSortFields
Description copied from interface:NavigableFieldReturn 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
NavigableField.getSortComparatorSource()If you implement this method there is no need to implement
NavigableField.getSortComparatorSource().- Specified by:
getSortFieldsin interfaceNavigableField- Returns:
- The name of the indexed term to be used for native Lucene sorting.
-
getColumnViewHtml
- Specified by:
getColumnViewHtmlin interfaceNavigableField
-
getHiddenFieldId
Description copied from interface:NavigableFieldReturns 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.- Specified by:
getHiddenFieldIdin interfaceNavigableField
-
prettyPrintChangeHistory
- Specified by:
prettyPrintChangeHistoryin interfaceNavigableField
-
prettyPrintChangeHistory
Description copied from interface:NavigableFieldUsed for email notification templates - allows changelog to be displayed in language of the recipient.- Specified by:
prettyPrintChangeHistoryin interfaceNavigableField- Parameters:
changeHistory- - label- Returns:
- String change history formatted according to locale in i18nHelper
-
getValueFromIssue
Description copied from interface:RenderableFieldGets the value stored for this field on the provided issue.- Specified by:
getValueFromIssuein interfaceRenderableField- Parameters:
issue- identifies the issue that will contain the value for this field.- Returns:
- the value stored on this issue for this field, null if not applicable.
-
isRenderable
public boolean isRenderable()Description copied from interface:RenderableFieldDefines if a field determines itself as renderable. This is needed because of the way that customfields are implemented. Since all the real work is done in CustomFieldTypes, if we want to treat system fields and custom fields the same way in the renderers then all custom fields must implement this interface. We therefore provide this method so that the CustomFieldImpl can delegate to the CustomFieldTypes to determine if a given custom field is renderable.- Specified by:
isRenderablein interfaceRenderableField- Returns:
- true if the field is renderable, false otherwise.
-
getCreateHtml
public String getCreateHtml(FieldLayoutItem fieldLayoutItem, OperationContext operationContext, webwork.action.Action action, Issue issue) Description copied from interface:OrderableFieldReturns the HTML that should be shown when the issue is being created.- Specified by:
getCreateHtmlin interfaceOrderableField<Object>- Parameters:
fieldLayoutItem- FieldLayoutItemoperationContext- OperationContextaction- Actionissue- Issue- Returns:
- the HTML that should be shown when the issue is being created.
-
getCreateHtml
public String getCreateHtml(FieldLayoutItem fieldLayoutItem, OperationContext operationContext, webwork.action.Action action, Issue issue, Map displayParameters) Description copied from interface:OrderableFieldReturns the HTML that should be shown when the issue is being created.- Specified by:
getCreateHtmlin interfaceOrderableField<Object>- Parameters:
fieldLayoutItem- FieldLayoutItemoperationContext- OperationContextaction- Actionissue- IssuedisplayParameters- Map of display parameters.- Returns:
- the HTML that should be shown when the issue is being created.
-
getEditHtml
public String getEditHtml(FieldLayoutItem fieldLayoutItem, OperationContext operationContext, webwork.action.Action action, Issue issue) Description copied from interface:OrderableFieldReturns HTML that should be shown when the issue is being edited.- Specified by:
getEditHtmlin interfaceOrderableField<Object>- Parameters:
fieldLayoutItem- FieldLayoutItemoperationContext- OperationContextaction- Actionissue- Issue- Returns:
- HTML that should be shown when the issue is being edited.
-
getEditHtml
public String getEditHtml(FieldLayoutItem fieldLayoutItem, OperationContext operationContext, webwork.action.Action action, Issue issue, Map displayParameters) Description copied from interface:OrderableFieldReturns HTML that should be shown when the issue is being edited.- Specified by:
getEditHtmlin interfaceOrderableField<Object>- Parameters:
fieldLayoutItem- FieldLayoutItemoperationContext- OperationContextaction- Actionissue- IssuedisplayParameters- Map of display parameters.- Returns:
- HTML that should be shown when the issue is being edited.
-
getBulkEditHtml
public String getBulkEditHtml(OperationContext operationContext, webwork.action.Action action, BulkEditBean bulkEditBean, Map displayParameters) Description copied from interface:OrderableFieldReturns HTML that should be shown when the issue is being bulk edited.- Specified by:
getBulkEditHtmlin interfaceOrderableField<Object>- Parameters:
operationContext- OperationContextaction- ActionbulkEditBean- BulkEditBeandisplayParameters- Map of display parameters.- Returns:
- HTML that should be shown when the issue is being edited.
-
getViewHtml
public String getViewHtml(FieldLayoutItem fieldLayoutItem, webwork.action.Action action, Issue issue) - Specified by:
getViewHtmlin interfaceOrderableField<Object>
-
getViewHtml
public String getViewHtml(FieldLayoutItem fieldLayoutItem, webwork.action.Action action, Issue issue, Map displayParameters) - Specified by:
getViewHtmlin interfaceOrderableField<Object>
-
getViewHtml
public String getViewHtml(FieldLayoutItem fieldLayoutItem, webwork.action.Action action, Issue issue, Object value, Map displayParameters) - Specified by:
getViewHtmlin interfaceOrderableField<Object>
-
isShown
Description copied from interface:OrderableFieldTests field specific way to determine if it should be shown or not.- Specified by:
isShownin interfaceOrderableField<Object>- Parameters:
issue- The Issue.- Returns:
- true if it should be shown.
-
populateDefaults
Description copied from interface:OrderableFieldPopulate the fieldValueHolder with a value that should be shown by default when the issue has not been created yet.- Specified by:
populateDefaultsin interfaceOrderableField<Object>- Parameters:
fieldValuesHolder- The fieldValuesHolder Map to be populated.issue- The Issue.
-
hasParam
Description copied from interface:OrderableFieldChecks to see if the (web) parameters contains a relevant value with which to populate the issue- Specified by:
hasParamin interfaceOrderableField<Object>- Parameters:
parameters- Map of HTTP request parameters ("Action parameters").
-
populateFromParams
Description copied from interface:OrderableFieldPopulate the fieldValuesHolder with a value from (web) parameters.- Specified by:
populateFromParamsin interfaceOrderableField<Object>- Parameters:
fieldValuesHolder- The fieldValuesHolder Map to be populated.parameters- Map of HTTP parameters.
-
populateFromIssue
Description copied from interface:OrderableFieldUsed to initialise the fieldValuesHolder from the current value of teh issue. Used, for example, when showing the Edit Issue screen to show the issue's current values.- Specified by:
populateFromIssuein interfaceOrderableField<Object>- Parameters:
fieldValuesHolder- The fieldValuesHolder Map to be populated.issue- The Issue.
-
validateParams
public void validateParams(OperationContext operationContext, ErrorCollection errorCollectionToAddTo, I18nHelper i18n, Issue issue, FieldScreenRenderLayoutItem fieldScreenRenderLayoutItem) Description copied from interface:OrderableFieldEnsure that the parameters are valid- Specified by:
validateParamsin interfaceOrderableField<Object>- Parameters:
operationContext- OperationContexterrorCollectionToAddTo- ErrorCollection to add to.i18n- I18nHelperissue- This is passed to get the value of other fields that may or may not have been modified.fieldScreenRenderLayoutItem- FieldScreenRenderLayoutItem
-
getDefaultValue
Description copied from interface:OrderableFieldThe value that should be set on the issue if the field is not shown for some reason.For example: The user does not have permission to see the field, or the field is not part of the create screen.
- Specified by:
getDefaultValuein interfaceOrderableField<Object>- Parameters:
issue- the Issue.- Returns:
- The default value. It can be null, or an empty collection.
-
createValue
Description copied from interface:OrderableFieldCreate the value of the issue in the data store.- Specified by:
createValuein interfaceOrderableField<Object>- Parameters:
issue- Issue this field is part ofvalue- Value to store in this field (eg. Collection for Version fields). Cannot be null.
-
updateValue
public void updateValue(FieldLayoutItem fieldLayoutItem, Issue issue, ModifiedValue modifiedValue, IssueChangeHolder issueChangeHolder) Description copied from interface:OrderableFieldUpdate the issue in the data store.Fields that are simply stored in the JIRAISSUE DB table, need not do anything here as this table is written to one time to include all fields that changed. Fields using other DB tables must update that table with the appropriate values.
- Specified by:
updateValuein interfaceOrderableField<Object>- Parameters:
fieldLayoutItem- for this field within this contextissue- Issue this field is part ofmodifiedValue- new value to set field to. Cannot be null.issueChangeHolder- an object to record any changes made to the issue by this method.
-
updateIssue
Description copied from interface:OrderableFieldRecord the value on the issue (not saving it to the database, see updateValue).- Specified by:
updateIssuein interfaceOrderableField<Object>- Parameters:
fieldLayoutItem- FieldLayoutItemissue- MutableIssuefieldValueHolder- Field Value Holder Map- See Also:
-
removeValueFromIssueObject
Description copied from interface:OrderableFieldRemoves 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.
- Specified by:
removeValueFromIssueObjectin interfaceOrderableField<Object>- Parameters:
issue- The issue object to be effected.- See Also:
-
canRemoveValueFromIssueObject
Description copied from interface:OrderableFieldReturnstrueif a call toOrderableField.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.
- Specified by:
canRemoveValueFromIssueObjectin interfaceOrderableField<Object>- Parameters:
issue- The Issue object.- Returns:
trueif a call toOrderableField.removeValueFromIssueObject(com.atlassian.jira.issue.MutableIssue)will actually remove the value.- See Also:
-
needsMove
public MessagedResult needsMove(Collection originalIssues, Issue targetIssue, FieldLayoutItem targetFieldLayoutItem) Description copied from interface:OrderableFieldUsed to determine if the field needs input from user to be moved to the new project and/or issue type. This method is called only if the field is visible in the target project/issue type.- Specified by:
needsMovein interfaceOrderableField<Object>- Parameters:
originalIssues- Collection of original Issues.targetIssue- Nonexistent issue object with values representing those of issue(s) after movetargetFieldLayoutItem- FieldLayoutItem- Returns:
- A MessagedResult with result=true if the field needs input to be moved.
-
populateForMove
public void populateForMove(Map<String, Object> fieldValuesHolder, Issue originalIssue, Issue targetIssue) Description copied from interface:OrderableFieldUsed to populate the fieldValueHolder with parameters for move issue screen. This field is only called if the issue needs to be updated during move, i.e.OrderableField.needsMove(java.util.Collection, com.atlassian.jira.issue.Issue, com.atlassian.jira.issue.fields.layout.field.FieldLayoutItem)returned true, and the remote user (the one performing the move) has the permission to actually update this field.- Specified by:
populateForMovein interfaceOrderableField<Object>- Parameters:
fieldValuesHolder- Map of field Values.originalIssue- orignal IssuetargetIssue- target Issue
-
hasValue
Description copied from interface:OrderableFieldDetermines if the field has a value for the given issue.- Specified by:
hasValuein interfaceOrderableField<Object>- Parameters:
issue- the Issue.- Returns:
- true if the given Issue has a value for this field.
-
availableForBulkEdit
Description copied from interface:OrderableFieldDetermines whether the field is available for bulk editing given the BulkEditBean.- Specified by:
availableForBulkEditin interfaceOrderableField<Object>- Parameters:
bulkEditBean- holds the state of the bulk-edit wizard (e.g. the selected issues for bulk editing)- Returns:
nullif the field is available for bulk-editing or an i18n key of the error message to show as why the field is not available.
-
getValueFromParams
Description copied from interface:OrderableFieldGet a field value from the map of parameters passed. The params map may contain other parameters that are not relevant to this custom field.- Specified by:
getValueFromParamsin interfaceOrderableField<Object>- Parameters:
params- the map of parameters.- Returns:
- Value for this field from the map of parameters.
- Throws:
FieldValidationException- if there is a problem with Field Validation.
-
populateParamsFromString
public void populateParamsFromString(Map fieldValuesHolder, String stringValue, Issue issue) throws FieldValidationException Description copied from interface:OrderableFieldUsed to convert from a user friendly string value and put the result into the fieldValuesHolder. This method is useful for places like Jelly where the field value can be a name (e.g. issue type name) and not a regular id that is used in the web pages.- Specified by:
populateParamsFromStringin interfaceOrderableField<Object>- Parameters:
fieldValuesHolder- Map of field Values.stringValue- user friendly string valueissue- the Issue- Throws:
FieldValidationException- if cannot convert to a value from the given string
-
createAssociatedSearchHandler
Description copied from interface:SearchableFieldReturnSearchHandlerfor the field. This object tells JIRA how to search for values within the field.- Specified by:
createAssociatedSearchHandlerin interfaceSearchableField- Returns:
- the SearchHandler associated with the field. Can return
nullwhen no searcher is associated with the field. This will mainly happen when a customfield is configured to have no searcher.
-
getFieldTypeInfo
Description copied from interface:RestAwareFieldReturns lower level Information about the field. This information contains allowed values and/or the autocomplete url- Specified by:
getFieldTypeInfoin interfaceRestAwareField- Parameters:
fieldTypeInfoContext- theFieldTypeInfoContextcontains context information that is relevant to generate theFieldTypeInfo
-
getJsonSchema
Description copied from interface:RestAwareFieldReturn a description of the shape of this field when represented as JSON.- Specified by:
getJsonSchemain interfaceRestAwareField
-
getJsonFromIssue
public FieldJsonRepresentation getJsonFromIssue(Issue issue, boolean renderedVersionRequested, @Nullable FieldLayoutItem fieldLayoutItem) Description copied from interface:RestAwareFieldReturn 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.- Specified by:
getJsonFromIssuein interfaceRestAwareField- Parameters:
issue- to get field data fromrenderedVersionRequested- whether the use requested the return of rendered/pretty data as well as raw datafieldLayoutItem- 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.
-
getRestFieldOperation
- Specified by:
getRestFieldOperationin interfaceRestFieldOperations- Returns:
- the RestFieldOperationsHandler for this field.
-
getJsonDefaultValue
Description copied from interface:RestFieldOperationsReturn The default data for this system field. May be null if there is no default.- Specified by:
getJsonDefaultValuein interfaceRestFieldOperations- Parameters:
issueCtx- Issue (This should really only need to be an issue context, but for historical reasons we need an issue object.
-
getId
Description copied from interface:FieldThe unique id of the field- Specified by:
getIdin interfaceField- Specified by:
getIdin interfaceRenderableField- Returns:
- the identifier for this RenderableField.
-
setId
-
getNameKey
Description copied from interface:FieldThe i18n key that is used to lookup the field's name when it is displayed- Specified by:
getNameKeyin interfaceField
-
getName
Description copied from interface:FieldReturns i18n'ed name of the field. -
getFieldName
Description copied from interface:CustomFieldReturns the title of this custom field.- Specified by:
getFieldNamein interfaceCustomField- Returns:
- the title of this custom field
-
compareTo
- Specified by:
compareToin interfaceComparable
-
toString
-
getPropertySet
public com.opensymphony.module.propertyset.PropertySet getPropertySet()- Specified by:
getPropertySetin interfaceCustomField
-
getUntranslatedDescription
Description copied from interface:CustomFieldReturns the description of this custom field by readingCustomField.ENTITY_DESCRIPTIONof the underlying generic value.- Specified by:
getUntranslatedDescriptionin interfaceCustomField- Returns:
- the description of this custom field
-
getUntranslatedName
Description copied from interface:CustomFieldReturns the name of this custom field by readingCustomField.ENTITY_NAMEof the underlying generic value.- Specified by:
getUntranslatedNamein interfaceCustomField- Returns:
- the name of this custom field
-
getUntranslatedDescriptionProperty
Description copied from interface:CustomFieldReturns aRenderablePropertyfor rendering this custom field's untranslated description, for admin.- Specified by:
getUntranslatedDescriptionPropertyin interfaceCustomField- Returns:
- a read-only RenderableProperty
-