import com.atlassian.jira.component.ComponentAccessor
import com.atlassian.jira.issue.Issue
Issue issue = issuedef customFieldManager = ComponentAccessor.getCustomFieldManager()
// the dependent custom field
def dateACF = customFieldManager.getCustomFieldObjectByName("Due Date")
// get the value of the Due Date custom field
def dateAValue = issue.getCustomFieldValue(dateACF) as Date
// build the new date
def dateB = Calendar.getInstance()
// copy to the new date the value of the Due Date custom field
dateB.setTime(dateAValue)
return dateB.getTime()
When I run this , I get an error as "java.lang.NullPointerException"
Can someone please help me out. Thanks