Hello,
So I want to set the custom field date to a certain time after the created date, depending on the condition. For example, if i choose "1 week" from the dropdown list, my "end date" custom field should be set to the date after issue's created date. I cant figure out what the problem is. Can you please help me? Thanks. Here is a part of my code:
def createdDate = issue.getCreated()
def whenShouldRestoreCF = customFieldManager.getCustomFieldObject("11335")
def endDateCF = customFieldManager.getCustomFieldObject("11334")
cal.setTime(createdDate)
if(whenShouldRestoreCF == "1 week"){
cal.add(Calendar.HOUR,168)
endDateCF = cal.toMonthDay()
//log.warn(endDateCF)
}
if(whenShouldRestoreCF == "2 week"){
cal.add(Calendar.MONTH,336)
endDateCF = cal.toMonthDay()
}
if(whenShouldRestoreCF == "3 week"){
cal.add(Calendar.MONTH,504)
endDateCF = cal.toMonthDay()
}