Interface CustomFields
- All Known Implementing Classes:
CustomFieldsImpl
public interface CustomFields
Actions for administering the custom fields in JIRA.
- Since:
- v4.0
-
Method Summary
Modifier and TypeMethodDescriptionaddConfigurationSchemeContext(FieldId fieldId, String label, String[] issueTypeIds, String[] projectIds) Adds a custom field configuration scheme context.addConfigurationSchemeContext(String numericCustomFieldId, String label, String[] issueTypeIds, String[] projectIds) Deprecated.addCustomField(String fieldType, String fieldName) Adds a custom field of the specified type to JIRA.addCustomField(String fieldType, String fieldName, String[] issueTypeIds, String[] projectIds) Adds a custom field of the specified type to JIRA.voidaddOptions(String numericCustomFieldId, String... options) Add options to a customfield that supports it (i.e.static StringbuiltInCustomFieldKey(String type) Turns a simple key into a complete key for a built in custom field typevoiddisableOptions(String numericCustomFieldId, String... options) disable options from a customfield that supports them (i.e.voideditConfigurationSchemeContextById(String numericCustomFieldId, String fieldConfigSchemeId, String label, String[] issueTypeIds, String[] projectIds) Alters an existing custom field configuration scheme context.voideditConfigurationSchemeContextByLabel(String numericCustomFieldId, String label, String newLabel, String[] issueTypeIds, String[] projectIds) Alters an existing custom field configuration scheme context.voideditOptionValue(String numericCustomFieldId, String option, String newValue) Change teh display value of an option from a customfield that supports them (i.e.voidenableOptions(String numericCustomFieldId, String... options) enable options from a customfield that supports them (i.e.static StringfuncTestCustomFieldKey(String type) voidgoToCustomFieldConfiguration(FieldId fieldId) Navigates to `Configure Custom Field` page.voidgoToCustomFieldConfiguration(String numericCustomFieldId) Deprecated.Please usegoToCustomFieldConfiguration(FieldId)static StringnumericCfId(String id) Turns a full customfield id into a numeric id (strips the customfield_ part).voidremoveConfigurationSchemeContextById(String numericCustomFieldId, String fieldConfigSchemeId) Removes the context from the specified custom field with the specified config scheme id.voidremoveConfigurationSchemeContextByLabel(String numericCustomFieldId, String fieldConfigSchemeLabel) Removes the context from the specified custom field with the specified config scheme id.voidremoveCustomField(String customFieldId) Removes the custom fieldvoidremoveGlobalContext(String numericCustomFieldId) Removes the global context from the specified custom field's configuration schemes.voidremoveOptions(String numericCustomFieldId, String... options) Remove options from a customfield that supports them (i.e.renameCustomField(String numericCustomFieldId, String newCustomFieldName) Renames the custom field.voidsetCascadingSelectDefaultValue(String numericCustomFieldId, String defValue, String cascadingDefValue) Set default value for any custom field that supports default value.setCustomFieldSearcher(String numericCustomFieldId, String searcherKey) Sets the searcher for the specified custom field.voidsetDefaultValue(FieldId fieldId, String defValue) Set default value for any custom field that supports default value.voidsetDefaultValue(String numericCustomFieldId, String defValue) Deprecated.please usesetDefaultValue(FieldId, String)
-
Method Details
-
addCustomField
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.- Parameters:
fieldType- the full name of the custom field type to add e.g.com.atlassian.jira.plugin.system.customfieldtypes:userpickerfieldName- 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
String addCustomField(String fieldType, String fieldName, String[] issueTypeIds, String[] projectIds) 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.- Parameters:
fieldType- the full name of the custom field type to add e.g.com.atlassian.jira.plugin.system.customfieldtypes:userpickerfieldName- the name of the custom field e.g.UserCFissueTypeIds- the ids of the issue types; must not be nullprojectIds- the ids of the projects; must not be null- Returns:
- the custom field id e.g.
customfield_10000
-
setCustomFieldSearcher
Sets the searcher for the specified custom field. Use the return value to reset the searcher to its previous value later.- Parameters:
numericCustomFieldId- the numeric custom field idsearcherKey- the full key of the searcher to use e.g.com.atlassian.jira.plugin.system.customfieldtypes:numberrange. Usenullto remove the searcher.- Returns:
- the previously used searcher key
-
renameCustomField
Renames the custom field.- Parameters:
numericCustomFieldId- the numeric custom field idnewCustomFieldName- the new name for the custom field e.g.My CF- Returns:
- the previously used name
-
addConfigurationSchemeContext
String addConfigurationSchemeContext(String numericCustomFieldId, String label, String[] issueTypeIds, String[] projectIds) Deprecated.Adds a custom field configuration scheme context.- Parameters:
numericCustomFieldId- the numeric custom field idlabel- the new nameissueTypeIds- the ids of the issue types; must not be nullprojectIds- the ids of the projects; must not be null- Returns:
- the numeric id of the field config scheme created e.g.
10013
-
addConfigurationSchemeContext
String addConfigurationSchemeContext(FieldId fieldId, String label, String[] issueTypeIds, String[] projectIds) Adds a custom field configuration scheme context.- Parameters:
fieldId- field idlabel- the new nameissueTypeIds- the ids of the issue types; must not be nullprojectIds- the ids of the projects; must not be null- Returns:
- the numeric id of the field config scheme created e.g.
10013
-
editConfigurationSchemeContextById
void editConfigurationSchemeContextById(String numericCustomFieldId, String fieldConfigSchemeId, String label, String[] issueTypeIds, String[] projectIds) Alters an existing custom field configuration scheme context.- Parameters:
numericCustomFieldId- the numeric custom field idfieldConfigSchemeId- the id of the schemelabel- the new name; use null if no update requiredissueTypeIds- the ids of the issue types; use null if no update requiredprojectIds- the ids of the projects; use null if no update required
-
editConfigurationSchemeContextByLabel
void editConfigurationSchemeContextByLabel(String numericCustomFieldId, String label, String newLabel, String[] issueTypeIds, String[] projectIds) Alters an existing custom field configuration scheme context.- Parameters:
numericCustomFieldId- the numeric custom field idlabel- the label of the schemenewLabel- the new name; use null if no update requiredissueTypeIds- the ids of the issue types; use null if no update requiredprojectIds- the ids of the projects; use null if no update required
-
removeGlobalContext
Removes the global context from the specified custom field's configuration schemes.- Parameters:
numericCustomFieldId- the numeric custom field id
-
removeConfigurationSchemeContextById
Removes the context from the specified custom field with the specified config scheme id.- Parameters:
numericCustomFieldId- the numeric custom field idfieldConfigSchemeId- the numeric field config scheme id
-
removeConfigurationSchemeContextByLabel
void removeConfigurationSchemeContextByLabel(String numericCustomFieldId, String fieldConfigSchemeLabel) Removes the context from the specified custom field with the specified config scheme id.- Parameters:
numericCustomFieldId- the numeric custom field idfieldConfigSchemeLabel- the label of the field config scheme
-
removeCustomField
Removes the custom field- Parameters:
customFieldId- the full custom field id e.g.customfield_10000
-
addOptions
Add options to a customfield that supports it (i.e. selectlist)- Parameters:
numericCustomFieldId- the numeric customfield idoptions- the options to add
-
setDefaultValue
Deprecated.please usesetDefaultValue(FieldId, String)Set default value for any custom field that supports default value.- Parameters:
numericCustomFieldId- the numeric customfield iddefValue- default value
-
setDefaultValue
Set default value for any custom field that supports default value.- Parameters:
fieldId- field iddefValue- default value
-
setCascadingSelectDefaultValue
void setCascadingSelectDefaultValue(String numericCustomFieldId, String defValue, String cascadingDefValue) Set default value for any custom field that supports default value.- Parameters:
numericCustomFieldId- the numeric customfield iddefValue- display text of default valuecascadingDefValue- display text of default cascading value
-
disableOptions
disable options from a customfield that supports them (i.e. selectlist)- Parameters:
numericCustomFieldId- the numeric custom field idoptions- to disable
-
enableOptions
enable options from a customfield that supports them (i.e. selectlist)- Parameters:
numericCustomFieldId- the numeric custom field idoptions- to enable
-
removeOptions
Remove options from a customfield that supports them (i.e. selectlist)- Parameters:
numericCustomFieldId- the numeric custom field idoptions- to remove
-
editOptionValue
Change teh display value of an option from a customfield that supports them (i.e. selectlist)- Parameters:
numericCustomFieldId- the numeric custom field idoption- id to change
-
goToCustomFieldConfiguration
Deprecated.Please usegoToCustomFieldConfiguration(FieldId)Navigates to `Configure Custom Field` page.- Parameters:
numericCustomFieldId- the numeric custom field id
-
goToCustomFieldConfiguration
Navigates to `Configure Custom Field` page.- Parameters:
fieldId- field id
-
builtInCustomFieldKey
Turns a simple key into a complete key for a built in custom field type- Parameters:
type- simple key- Returns:
- complete key for the given built-in custom field type
-
funcTestCustomFieldKey
-
numericCfId
Turns a full customfield id into a numeric id (strips the customfield_ part).- Parameters:
id- full customfield id.- Returns:
- numeric part of the customfield id.
-
addConfigurationSchemeContext(FieldId, String, String[], String[])