Created
January 25, 2017 08:54
-
-
Save jechlin/d66bfd81334956633b99aed8ae899f91 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package examples | |
import com.atlassian.jira.component.ComponentAccessor | |
import com.onresolve.jira.groovy.metadata.JiraMetadataDSL | |
import groovy.transform.BaseScript | |
def customFieldManager = ComponentAccessor.getCustomFieldManager() | |
@BaseScript JiraMetadataDSL delegate | |
customfields([ | |
[ | |
"name" : 'mould.Xxxxxx', | |
"description" : 'description', | |
"type" : "com.atlassian.jira.plugin.system.customfieldtypes:textfield", | |
"searcher" : "com.atlassian.jira.plugin.system.customfieldtypes:textsearcher", | |
"fieldConfigs": [ | |
[ | |
"name" : "default", | |
"context": [ | |
"projects": [ | |
'SERVERS' | |
], | |
] | |
] | |
], | |
"properties" : ["key": "mould", "required": true] | |
] | |
]) | |
def customField = customFieldManager.getCustomFieldObjectByName("mould.Xxxxxx") | |
log.debug customField.getUntranslatedName() | |
def CUSTOM_FIELD_NAME_FORMAT = "jira.translation.custom.field%s.name.%s" | |
def cfNameFormat = String.format(CUSTOM_FIELD_NAME_FORMAT, customField.getId(), Locale.UK) | |
customField.getPropertySet().setString(cfNameFormat, "Xxxxxx") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment