Hi Team,
I am trying to populate a Date field by Adding days to another date field value.
Consider, there are two date fields "Start Date" & "End Date" and a numeric field "Number Field" for days.
Required Output : End Date = Start Date+NumberField
How can I achieve this with the groovy script?
I used the below code but getting below error, Please help me on this.
Issue issue = issue
def customFieldManager = ComponentAccessor.getCustomFieldManager()
def daysToAddCF = customFieldManager.getCustomFieldObjectByName("Duration")
def dateACF = customFieldManager.getCustomFieldObjectByName("StartDate")
def dateAValue = issue.getCustomFieldValue(dateACF) as Date
def daysToAdd = issue.getCustomFieldValue(daysToAddCF) as int
def EndDate = Calendar.getInstance()
EndDate.setTime(dateAValue)
EndDate.add(Calendar.DATE, daysToAdd)
return EndDate.getTime()
