Hi,
I am writing behavior for approval date during the approval transition for one of my issue. Look like I can set to default current date but unable to save the changes that user selected manually/changed the date. How I can allow users to select date if the approval date is not current date during the approval transition
Here is the code that I wrote
import com.atlassian.jira.component.ComponentAccessor
import java.text.SimpleDateFormat
import java.util.Date
import java.util.TimeZone
def appDatefld = getFieldById(getFieldChanged())
//def the "results" field from the view screen (underlying issue)
def customFieldManager = ComponentAccessor.getCustomFieldManager()
def appDatefldId = customFieldManager.getCustomFieldObject(appDatefld.getFieldId())
String DATE_FORMAT = "dd/MM/yy"
SimpleDateFormat formatter = new SimpleDateFormat(DATE_FORMAT)
String CurrentDate = new java.sql.Timestamp(new Date().getTime()).format('MM/dd/yyyy')
//Date date = formatter.parse(CurrentDate)
if (!underlyingIssue?.getCustomFieldValue(appDatefldId)) {
appDatefld.setFormValue(CurrentDate)
}
Any suggestion?