com.atlassian.jira.functest.framework.admin
Class CustomFieldsImpl

java.lang.Object
  extended by com.atlassian.jira.functest.framework.AbstractFuncTestUtil
      extended by com.atlassian.jira.functest.framework.admin.CustomFieldsImpl
All Implemented Interfaces:
CustomFields, com.atlassian.jira.testkit.client.log.FuncTestLogger

public class CustomFieldsImpl
extends AbstractFuncTestUtil
implements CustomFields

Since:
v4.0

Field Summary
 
Fields inherited from class com.atlassian.jira.functest.framework.AbstractFuncTestUtil
environmentData, FS, locators, logger, logIndentLevel, tester
 
Constructor Summary
CustomFieldsImpl(net.sourceforge.jwebunit.WebTester tester, JIRAEnvironmentData environmentData, Navigation navigation, Form form)
           
 
Method Summary
 String addConfigurationSchemeContext(String customFieldId, String label, String[] issueTypeIds, String[] projectIds)
          Adds a custom field configuration scheme context.
 String addCustomField(String fieldType, String fieldName)
          Adds a custom field of the specified type to JIRA.
 String addCustomField(String fieldType, String fieldName, String[] issueTypes, String[] projects)
          Adds a custom field of the specified type to JIRA.
 void addOptions(String numericCustomFieldId, String... options)
          Add options to a customfield that supports it (i.e.
 void disableOptions(String numericCustomFieldId, String... options)
          disable options from a customfield that supports them (i.e.
 void editConfigurationSchemeContextById(String customFieldId, String fieldConfigSchemeId, String label, String[] issueTypeIds, String[] projectIds)
          Alters an existing custom field configuration scheme context.
 void editConfigurationSchemeContextByLabel(String numericCustomFieldId, String label, String newLabel, String[] issueTypeIds, String[] projectIds)
          Alters an existing custom field configuration scheme context.
 void editOptionValue(String numericCustomFieldId, String option, String newValue)
          Change teh display value of an option from a customfield that supports them (i.e.
 void enableOptions(String numericCustomFieldId, String... options)
          enable options from a customfield that supports them (i.e.
 void removeConfigurationSchemeContextById(String numericCustomFieldId, String fieldConfigSchemeId)
          Removes the context from the specified custom field with the specified config scheme id.
 void removeConfigurationSchemeContextByLabel(String numericCustomFieldId, String fieldConfigSchemeLabel)
          Removes the context from the specified custom field with the specified config scheme id.
 void removeCustomField(String customFieldId)
          Removes the custom field
 void removeGlobalContext(String customFieldId)
          Removes the global context from the specified custom field's configuration schemes.
 void removeOptions(String numericCustomFieldId, String... options)
          Remove options from a customfield that supports them (i.e.
 String renameCustomField(String numericCustomFieldId, String newCustomFieldName)
          Renames the custom field.
 String setCustomFieldSearcher(String customFieldId, String searcherKey)
          Sets the searcher for the specified custom field.
 void setDefaultValue(String numericCustomFieldId, String defValue)
          Set default value for any custom field that supports default value.
 
Methods inherited from class com.atlassian.jira.functest.framework.AbstractFuncTestUtil
childLogIndentLevel, getAssertions, getEnvironmentData, getFuncTestHelperFactory, getLogger, log, log, navigation, submitAtPage
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CustomFieldsImpl

public CustomFieldsImpl(net.sourceforge.jwebunit.WebTester tester,
                        JIRAEnvironmentData environmentData,
                        Navigation navigation,
                        Form form)
Method Detail

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

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

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


Copyright © 2002-2014 Atlassian. All Rights Reserved.