Interface ICustomFieldsProvider

All Known Subinterfaces:
ICustomFieldsService

public interface ICustomFieldsProvider
Custom fields provider.
  • Field Details

    • CONFLICT_PREFIX

      @NotNull static final String CONFLICT_PREFIX
      The Prefix that is given to the id and name of a custom field whose id conflicts with the id of a built-in field.
      Since:
      3.2.3
      See Also:
  • Method Details

    • getAllCustomFields

      @NotNull List<ICustomField> getAllCustomFields(@NotNull String prototypeName, @NotNull IContextId contextId)
      Parameters:
      prototypeName - The prototype of the object e.g. "WorkItem" (not null).
      contextId - For example of a project.
      Returns:
      A list of ICustomField, that returns all of the custom features defined for the given prototype in the given context. This even includes the features conditionally defined based on the value of some other feature.
    • getDefinedCustomFields

      @NotNull List<ICustomField> getDefinedCustomFields(@NotNull String prototypeName, @NotNull IContextId contextId, @Nullable Object controlValue)
      Parameters:
      prototypeName - The prototype of the object e.g. "WorkItem" (not null).
      contextId - For example of a project.
      controlValue - The control field value (for example "requirement" or "task" for Work Items that have "type" as the control field), can be either String or IEnumOption or null if there is no control field.
      Returns:
      A list of ICustomField, that returns all the custom features defined for the given prototype in the given context with the given control value.
      Since:
      3.3.0
    • getControlField

      @Nullable String getControlField(@NotNull String prototypeName)
      Returns the name of the field that controls the set of custom fields defined for the object of the given prototype.
      Parameters:
      prototypeName - The prototype of the object, for example, "WorkItem" (not null).
      Returns:
      The control field id or null if there is none defined.
      Since:
      3.1.2
    • isCustomFieldDefined

      @Deprecated boolean isCustomFieldDefined(@NotNull String featureId, @NotNull String prototypeName, @NotNull IContextId contextId)
      Deprecated.
      use isCustomFieldDefined(String, String, IContextId, Object) Returns true, if a feature with such a name is, even conditionally, defined for the given prototype in the given context.
      Returns:
      true if the field is defined
    • isCustomFieldDefined

      boolean isCustomFieldDefined(@NotNull String featureId, @NotNull String prototypeName, @NotNull IContextId contextId, @Nullable Object controlValue)
      Returns true if a feature with such a name is, even conditionally, defined for the given prototype in the given context.
      Parameters:
      featureId - The custom field id e.g. "targetRelease", "risk" (not null)
      controlValue - The control field value (for example "requirement" or "task" for Work Items that have "type" as the control field), can be either String or IEnumOption or null if there is no control field.
      prototypeName - The prototype of the object, for example, "WorkItem" (not null)
      contextId - For example of a project.
      Returns:
      true if the field is defined.
      Since:
      3.1.2
      See Also:
    • getCustomField

      @Deprecated @NotNull ICustomField getCustomField(@NotNull String featureId, @NotNull String prototypeName, @NotNull IContextId contextId)
      Returns:
      Returns the given custom feature for the given prototype and context, or a fake String feature definition if the feature is not defined. (The fake String definition should be used for processing unknown custom fields).
    • getCustomField

      @NotNull ICustomField getCustomField(@NotNull String featureId, @NotNull String prototypeName, @NotNull IContextId contextId, @Nullable Object controlValue)
      Parameters:
      featureId - The custom field id, for example, "targetRelease", "risk" (not null)
      prototypeName - The prototype of the object, for example, "WorkItem" (not null)
      contextId - For example of a project.
      controlValue - The control field value (for example "requirement" or "task" for Work Items that have "type" as the control field,) can be either String or IEnumOption) or null if there is no control field.
      Returns:
      Returns the given custom feature for the given prototype and context, or a fake String feature definition, if the feature is not defined. (The fake String definition should be used for processing unknown custom fields.)
      Since:
      3.1.2
      See Also:
    • getListCustomField

      @Deprecated @NotNull ICustomField getListCustomField(@NotNull String featureId, @NotNull String prototypeName, @NotNull IContextId contextId)
      Deprecated.
      use getListCustomField(String, String, IContextId, Object) Similar to getCustomField(String, String, IContextId), but ensures that the resulting feature has the IListType, otherwise an exception is thrown. If no such custom feature is defined, then a fake list of String feature is returned.
      Returns:
      the ICustomField for the specified parameters
    • getListCustomField

      @NotNull ICustomField getListCustomField(@NotNull String featureId, @NotNull String prototypeName, @NotNull IContextId contextId, @Nullable Object controlValue)
      Similar to getCustomField(String, String, IContextId), but ensures, that the resulting feature has the IListType, otherwise an exception is thrown. If no such custom feature is defined, then a fake list of String feature is returned.
      Parameters:
      featureId - The custom field id e.g. "targetRelease", "risk" (not null)
      prototypeName - The prototype of the object, for example, "WorkItem" (not null)
      contextId - For example of a project.
      controlValue - The control field value (for example "requirement" or "task" for Work Items that have "type" as the control field), can be either String or IEnumOption) or null if there is no control field.
      Returns:
      the ICustomField for the specified parameters.
      Since:
      3.1.2
      See Also: