I am trying to figure out how to get the value of a project custom field that was created with ProFields. I have the below script that gets me the project from which I can see the values of standard fields. I am also able to identify the correct custom field. How do I get the value for this custom field for the given project?
import com.atlassian.jira.bc.project.ProjectService
import com.atlassian.jira.component.ComponentAccessor
def projectKey = "AIU20180523"
def projectManager = ComponentAccessor.projectManager
def projectService = ComponentAccessor.getComponent(ProjectService)
def existedProject = projectManager.getProjectObjByKey(projectKey)
if (existedProject) {
log.warn("The project with key ${projectKey} exists")
}
def project = ComponentAccessor.getProjectManager().getProjectByCurrentKey(projectKey);
log.warn ("Project name: " + project.name)
def customField = ComponentAccessor.getCustomFieldManager().getCustomFieldObject(11000L);
log.warn ("Field name: " + customField)
As shown below the log is showing the correct results for everything scripted, I just need the actual value of the Adjusted Completion Date profiled custom field for the project key AIU20180523.
2019-04-16 15:27:06,603 WARN [runner.ScriptRunnerImpl]: The project with key AIU20180523 exists
2019-04-16 15:27:06,603 WARN [runner.ScriptRunnerImpl]: Project name: Avaya IC Upgrage-Exec
2019-04-16 15:27:06,603 WARN [runner.ScriptRunnerImpl]: Field name: Adjusted Completion Date