Class CustomFieldsImpl

java.lang.Object
com.atlassian.jira.functest.framework.admin.CustomFieldsImpl
All Implemented Interfaces:
CustomFields

public class CustomFieldsImpl extends Object implements CustomFields
Since:
v4.0
  • Constructor Details

    • CustomFieldsImpl

      @Inject public CustomFieldsImpl(net.sourceforge.jwebunit.WebTester tester, JIRAEnvironmentData environmentData, Navigation navigation, Form form)
  • Method Details

    • addCustomField

      public String addCustomField(String fieldType, String fieldName)
      Description copied from interface: CustomFields
      Adds a custom field of the specified type to JIRA.

      The default searcher is used, and the custom field is added to the global project/issue type context.

      The field is added to the Default Screen.

      Specified by:
      addCustomField in interface CustomFields
      Parameters:
      fieldType - the full name of the custom field type to add e.g. com.atlassian.jira.plugin.system.customfieldtypes:userpicker
      fieldName - the name of the custom field e.g. UserCF
      Returns:

      A formatted String containing the id of the custom field, the format used is: customfield_customfield-id

      For example, customfield_10000

    • addCustomField

      public String addCustomField(String fieldType, String fieldName, String[] issueTypes, String[] projects)
      Description copied from interface: CustomFields
      Adds a custom field of the specified type to JIRA.

      The default searcher is used. The context is created for the specified issue types and projects.

      The field is added to the Default Screen.

      Specified by:
      addCustomField in interface CustomFields
      Parameters:
      fieldType - the full name of the custom field type to add e.g. com.atlassian.jira.plugin.system.customfieldtypes:userpicker
      fieldName - the name of the custom field e.g. UserCF
      issueTypes - the ids of the issue types; must not be null
      projects - the ids of the projects; must not be null
      Returns:
      the custom field id e.g. customfield_10000
    • setCustomFieldSearcher

      public String setCustomFieldSearcher(String customFieldId, String searcherKey)
      Description copied from interface: CustomFields
      Sets the searcher for the specified custom field. Use the return value to reset the searcher to its previous value later.
      Specified by:
      setCustomFieldSearcher in interface CustomFields
      Parameters:
      customFieldId - the numeric custom field id
      searcherKey - the full key of the searcher to use e.g. com.atlassian.jira.plugin.system.customfieldtypes:numberrange. Use null to remove the searcher.
      Returns:
      the previously used searcher key
    • renameCustomField

      public String renameCustomField(String numericCustomFieldId, String newCustomFieldName)
      Description copied from interface: CustomFields
      Renames the custom field.
      Specified by:
      renameCustomField in interface CustomFields
      Parameters:
      numericCustomFieldId - the numeric custom field id
      newCustomFieldName - the new name for the custom field e.g. My CF
      Returns:
      the previously used name
    • addConfigurationSchemeContext

      public String addConfigurationSchemeContext(String customFieldId, String label, String[] issueTypeIds, String[] projectIds)
      Description copied from interface: CustomFields
      Adds a custom field configuration scheme context.
      Specified by:
      addConfigurationSchemeContext in interface CustomFields
      Parameters:
      customFieldId - the numeric custom field id
      label - the new name
      issueTypeIds - the ids of the issue types; must not be null
      projectIds - the ids of the projects; must not be null
      Returns:
      the numeric id of the field config scheme created e.g. 10013
    • addConfigurationSchemeContext

      public String addConfigurationSchemeContext(FieldId fieldId, String label, String[] issueTypeIds, String[] projectIds)
      Description copied from interface: CustomFields
      Adds a custom field configuration scheme context.
      Specified by:
      addConfigurationSchemeContext in interface CustomFields
      Parameters:
      fieldId - field id
      label - the new name
      issueTypeIds - the ids of the issue types; must not be null
      projectIds - the ids of the projects; must not be null
      Returns:
      the numeric id of the field config scheme created e.g. 10013
    • editConfigurationSchemeContextById

      public void editConfigurationSchemeContextById(String customFieldId, String fieldConfigSchemeId, String label, String[] issueTypeIds, String[] projectIds)
      Description copied from interface: CustomFields
      Alters an existing custom field configuration scheme context.
      Specified by:
      editConfigurationSchemeContextById in interface CustomFields
      Parameters:
      customFieldId - the numeric custom field id
      fieldConfigSchemeId - the id of the scheme
      label - the new name; use null if no update required
      issueTypeIds - the ids of the issue types; use null if no update required
      projectIds - the ids of the projects; use null if no update required
    • editConfigurationSchemeContextByLabel

      public void editConfigurationSchemeContextByLabel(String numericCustomFieldId, String label, String newLabel, String[] issueTypeIds, String[] projectIds)
      Description copied from interface: CustomFields
      Alters an existing custom field configuration scheme context.
      Specified by:
      editConfigurationSchemeContextByLabel in interface CustomFields
      Parameters:
      numericCustomFieldId - the numeric custom field id
      label - the label of the scheme
      newLabel - the new name; use null if no update required
      issueTypeIds - the ids of the issue types; use null if no update required
      projectIds - the ids of the projects; use null if no update required
    • removeGlobalContext

      public void removeGlobalContext(String customFieldId)
      Description copied from interface: CustomFields
      Removes the global context from the specified custom field's configuration schemes.
      Specified by:
      removeGlobalContext in interface CustomFields
      Parameters:
      customFieldId - the numeric custom field id
    • removeConfigurationSchemeContextById

      public void removeConfigurationSchemeContextById(String numericCustomFieldId, String fieldConfigSchemeId)
      Description copied from interface: CustomFields
      Removes the context from the specified custom field with the specified config scheme id.
      Specified by:
      removeConfigurationSchemeContextById in interface CustomFields
      Parameters:
      numericCustomFieldId - the numeric custom field id
      fieldConfigSchemeId - the numeric field config scheme id
    • removeConfigurationSchemeContextByLabel

      public void removeConfigurationSchemeContextByLabel(String numericCustomFieldId, String fieldConfigSchemeLabel)
      Description copied from interface: CustomFields
      Removes the context from the specified custom field with the specified config scheme id.
      Specified by:
      removeConfigurationSchemeContextByLabel in interface CustomFields
      Parameters:
      numericCustomFieldId - the numeric custom field id
      fieldConfigSchemeLabel - the label of the field config scheme
    • removeCustomField

      public void removeCustomField(String customFieldId)
      Description copied from interface: CustomFields
      Removes the custom field
      Specified by:
      removeCustomField in interface CustomFields
      Parameters:
      customFieldId - the full custom field id e.g. customfield_10000
    • addOptions

      public void addOptions(String numericCustomFieldId, String... options)
      Description copied from interface: CustomFields
      Add options to a customfield that supports it (i.e. selectlist)
      Specified by:
      addOptions in interface CustomFields
      Parameters:
      numericCustomFieldId - the numeric customfield id
      options - the options to add
    • setDefaultValue

      public void setDefaultValue(String numericCustomFieldId, String defValue)
      Description copied from interface: CustomFields
      Set default value for any custom field that supports default value.
      Specified by:
      setDefaultValue in interface CustomFields
      Parameters:
      numericCustomFieldId - the numeric customfield id
      defValue - default value
    • setDefaultValue

      public void setDefaultValue(FieldId fieldId, String defValue)
      Description copied from interface: CustomFields
      Set default value for any custom field that supports default value.
      Specified by:
      setDefaultValue in interface CustomFields
      Parameters:
      fieldId - field id
      defValue - default value
    • setCascadingSelectDefaultValue

      public void setCascadingSelectDefaultValue(String numericCustomFieldId, String defValue, String cascadingDefValue)
      Description copied from interface: CustomFields
      Set default value for any custom field that supports default value.
      Specified by:
      setCascadingSelectDefaultValue in interface CustomFields
      Parameters:
      numericCustomFieldId - the numeric customfield id
      defValue - display text of default value
      cascadingDefValue - display text of default cascading value
    • removeOptions

      public void removeOptions(String numericCustomFieldId, String... options)
      Description copied from interface: CustomFields
      Remove options from a customfield that supports them (i.e. selectlist)
      Specified by:
      removeOptions in interface CustomFields
      Parameters:
      numericCustomFieldId - the numeric custom field id
      options - to remove
    • disableOptions

      public void disableOptions(String numericCustomFieldId, String... options)
      Description copied from interface: CustomFields
      disable options from a customfield that supports them (i.e. selectlist)
      Specified by:
      disableOptions in interface CustomFields
      Parameters:
      numericCustomFieldId - the numeric custom field id
      options - to disable
    • enableOptions

      public void enableOptions(String numericCustomFieldId, String... options)
      Description copied from interface: CustomFields
      enable options from a customfield that supports them (i.e. selectlist)
      Specified by:
      enableOptions in interface CustomFields
      Parameters:
      numericCustomFieldId - the numeric custom field id
      options - to enable
    • editOptionValue

      public void editOptionValue(String numericCustomFieldId, String option, String newValue)
      Description copied from interface: CustomFields
      Change teh display value of an option from a customfield that supports them (i.e. selectlist)
      Specified by:
      editOptionValue in interface CustomFields
      Parameters:
      numericCustomFieldId - the numeric custom field id
      option - id to change
    • goToCustomFieldConfiguration

      public void goToCustomFieldConfiguration(String numericCustomFieldId)
      Description copied from interface: CustomFields
      Navigates to `Configure Custom Field` page.
      Specified by:
      goToCustomFieldConfiguration in interface CustomFields
      Parameters:
      numericCustomFieldId - the numeric custom field id
    • goToCustomFieldConfiguration

      public void goToCustomFieldConfiguration(FieldId fieldId)
      Description copied from interface: CustomFields
      Navigates to `Configure Custom Field` page.
      Specified by:
      goToCustomFieldConfiguration in interface CustomFields
      Parameters:
      fieldId - field id