import com.atlassian.jira.component.ComponentAccessor
def issueManager = ComponentAccessor.getIssueManager()
if (getBehaviourContextId() == "create-change-pmo") {
getFieldById("project-field").setReadOnly(true)
getFieldById("issuetype-field").setReadOnly(true)
def contextIssue = issueManager.getIssueObject(getContextIssueId())
getFieldById("issuelinks-linktype").setFormValue("Linked by Change").setReadOnly(true)
getFieldById("issuelinks-issues").setFormValue(contextIssue.key).setReadOnly(true)
getFieldById("assignee").setFormValue(contextIssue.assigneeId).setReadOnly(false)
getFieldByName("Name of 3rd Party Issues")setHidden(true)
getFieldByName("Name of Dependant Project or Programme").setHidden(true)
getFieldByName("Other Details").setHidden(true)
}
This is from the ScriptRunner library - it works fine. However I also need to copy a customfield date from the parent and I am using this code,
getFieldById("customfield_33008").setFormValue(contextIssue.getCustomFieldValue(customFieldManager.getCustomFieldObject("customfield_33008"))).setReadOnly((false))
This example attempts to put a long number into the date field (see attachments) I don't understand why that would be happening as they are both date fields of the same name. If I try changing the code (removing the FieldManger part it does nothing). can someone assist?