com.atlassian.jira.issue.fields
Interface CustomField

All Superinterfaces:
Comparable, ConfigurableField, Field, HideableField, NavigableField, OrderableField, RenderableField, RequirableField, SearchableField
All Known Implementing Classes:
CustomFieldImpl

public interface CustomField
extends NavigableField, HideableField, ConfigurableField, RenderableField, RequirableField, OrderableField

Custom Field interface. Typically one obtains a CustomField using CustomFieldManager, eg. CustomFieldManager.getCustomFieldObjectByName(String)

To create or update an instance of a CustomField for an issue (a CustomFieldValue), use OrderableField.createValue(com.atlassian.jira.issue.Issue, Object) or OrderableField.updateValue(com.atlassian.jira.issue.fields.layout.field.FieldLayoutItem,com.atlassian.jira.issue.Issue,com.atlassian.jira.issue.ModifiedValue,com.atlassian.jira.issue.util.IssueChangeHolder).

See Also:
CustomFieldValue - a value of this field for a specific issue, CustomFieldType - The type of custom field (text, number, user picker etc).

Field Summary
 
Fields inherited from interface com.atlassian.jira.issue.fields.NavigableField
ORDER_ASCENDING, ORDER_DESCENDING, TEMPLATE_DIRECTORY_PATH
 
Fields inherited from interface com.atlassian.jira.issue.fields.OrderableField
MOVE_ISSUE_PARAM_KEY, NO_HEADER_PARAM_KEY, TEMPLATE_DIRECTORY_PATH
 
Method Summary
 int compare(Issue issue1, Issue issue2)
           
 List getAssociatedIssueTypes()
          Returns a list of issue types associated with this project.
 List getAssociatedProjectCategories()
           
 List getAssociatedProjects()
          Returns a list of projects associated with this project.
 List getConfigurationSchemes()
           
 CustomFieldSearcher getCustomFieldSearcher()
           
 CustomFieldType getCustomFieldType()
           
 CustomFieldParams getCustomFieldValues(Map customFieldValuesHolder)
          Get the custom field string values that are relevant to this particular custom field
 String getDescription()
           
 FieldConfig getFirstRelevantConfig(org.ofbiz.core.entity.GenericValue project, List issueTypeIds)
           
 org.ofbiz.core.entity.GenericValue getGenericValue()
          Deprecated.  
 Long getIdAsLong()
           
 Options getOptions(String key, FieldConfig config, JiraContextNode contextNode)
           
 Options getOptions(String key, JiraContextNode jiraContextNode)
          A list of the available options for this custom field.
 FieldConfig getRelevantConfig(Issue issue)
          Returns the field configuration applying to this field in the specified issue.
 FieldConfig getRelevantConfig(IssueContext issueContext)
           
 FieldConfig getReleventConfig(SearchContext searchContext)
          The FieldConfig that is relevent to all issue contexts in the search context
 Object getValue(Issue issue)
          As far as I can tell - this is just an object that contains the value of a custom field, so that it can be passed around.
 boolean isAllIssueTypes()
           
 boolean isAllProjects()
           
 boolean isEditable()
           
 boolean isEnabled()
          Returns if the custom field is enabled for any issue type / projects
 boolean isGlobal()
          Returns true if the custom field applies for all projects and all issue types
 boolean isInScope(User remoteUser, org.ofbiz.core.entity.GenericValue project, List issueTypeIds)
          This is used for determining whether we can view a custom field in view issue.
 boolean isInScope(User user, SearchContext searchContext)
           
 Set remove()
          return set of issues affected
 void setCustomFieldSearcher(CustomFieldSearcher searcher)
           
 void setDescription(String description)
           
 void setName(String name)
           
 void store()
           
 void validateFromActionParams(Map actionParameters, ErrorCollection errorCollection, FieldConfig config)
           
 
Methods inherited from interface com.atlassian.jira.issue.fields.NavigableField
getColumnCssClass, getColumnHeadingKey, getColumnViewHtml, getDefaultSortOrder, getHiddenFieldId, getSortComparatorSource, getSorter, prettyPrintChangeHistory, prettyPrintChangeHistory
 
Methods inherited from interface com.atlassian.jira.issue.fields.Field
getId, getName, getNameKey
 
Methods inherited from interface java.lang.Comparable
compareTo
 
Methods inherited from interface com.atlassian.jira.issue.fields.ConfigurableField
getConfigurationItemTypes
 
Methods inherited from interface com.atlassian.jira.issue.fields.OrderableField
availableForBulkEdit, createValue, getBulkEditHtml, getCreateHtml, getCreateHtml, getDefaultValue, getEditHtml, getEditHtml, getValueFromParams, getViewHtml, getViewHtml, getViewHtml, hasValue, isShown, needsMove, populateDefaults, populateForMove, populateFromIssue, populateFromParams, populateParamsFromString, removeValue, updateIssue, updateValue, validateParams
 
Methods inherited from interface com.atlassian.jira.issue.fields.SearchableField
getAssociatedSearchers
 
Methods inherited from interface com.atlassian.jira.issue.fields.renderer.RenderableField
getId, getValueFromIssue, isRenderable
 

Method Detail

isInScope

public boolean isInScope(User remoteUser,
                         org.ofbiz.core.entity.GenericValue project,
                         List issueTypeIds)
This is used for determining whether we can view a custom field in view issue.

Parameters:
issueTypeIds - Eg ["1", "2"] for Bugs and New Features

getGenericValue

public org.ofbiz.core.entity.GenericValue getGenericValue()
Deprecated.  


compare

public int compare(Issue issue1,
                   Issue issue2)

getCustomFieldValues

public CustomFieldParams getCustomFieldValues(Map customFieldValuesHolder)
Get the custom field string values that are relevant to this particular custom field

Parameters:
customFieldValuesHolder - containing all params
Returns:
a CustomFieldParams of String objects

getValue

public Object getValue(Issue issue)
As far as I can tell - this is just an object that contains the value of a custom field, so that it can be passed around. This is only used to communicate with the 'view' JSP.

Multiselects will return a list, dates a date,

See Also:
OrderableField.getValueFromParams(java.util.Map)

remove

public Set remove()
return set of issues affected


getOptions

public Options getOptions(String key,
                          JiraContextNode jiraContextNode)
A list of the available options for this custom field.

As this is just used by the view layer, it can be a list of objects

Returns:
A list of Objects

setName

public void setName(String name)

getDescription

public String getDescription()

setDescription

public void setDescription(String description)

getCustomFieldSearcher

public CustomFieldSearcher getCustomFieldSearcher()

setCustomFieldSearcher

public void setCustomFieldSearcher(CustomFieldSearcher searcher)

store

public void store()

isEditable

public boolean isEditable()

getIdAsLong

public Long getIdAsLong()

getConfigurationSchemes

public List getConfigurationSchemes()

getOptions

public Options getOptions(String key,
                          FieldConfig config,
                          JiraContextNode contextNode)

getRelevantConfig

public FieldConfig getRelevantConfig(Issue issue)
Returns the field configuration applying to this field in the specified issue.


getFirstRelevantConfig

public FieldConfig getFirstRelevantConfig(org.ofbiz.core.entity.GenericValue project,
                                          List issueTypeIds)

validateFromActionParams

public void validateFromActionParams(Map actionParameters,
                                     ErrorCollection errorCollection,
                                     FieldConfig config)

getAssociatedProjectCategories

public List getAssociatedProjectCategories()

getAssociatedProjects

public List getAssociatedProjects()
Returns a list of projects associated with this project. Will be null if the field is global

Specified by:
getAssociatedProjects in interface ConfigurableField
Returns:
List of project generic values

getAssociatedIssueTypes

public List getAssociatedIssueTypes()
Returns a list of issue types associated with this project. Will be null if the field is global

Returns:
List of issue type generic values

isGlobal

public boolean isGlobal()
Returns true if the custom field applies for all projects and all issue types

Returns:
boolean

isAllProjects

public boolean isAllProjects()

isAllIssueTypes

public boolean isAllIssueTypes()

isEnabled

public boolean isEnabled()
Returns if the custom field is enabled for any issue type / projects

Returns:

getCustomFieldType

public CustomFieldType getCustomFieldType()

getRelevantConfig

public FieldConfig getRelevantConfig(IssueContext issueContext)
Specified by:
getRelevantConfig in interface ConfigurableField

getReleventConfig

public FieldConfig getReleventConfig(SearchContext searchContext)
The FieldConfig that is relevent to all issue contexts in the search context

Parameters:
searchContext -

isInScope

public boolean isInScope(User user,
                         SearchContext searchContext)


Copyright © 2002-2006 Atlassian. All Rights Reserved.