Hi team,
I need a scripted field to calculate the days from Due date - Reported date(Custom field).
I have a script which calculates todays date - Reported date(script is given below).
Can you please help me in modifying the script to get the exact request.
Script:
import com.atlassian.jira.component.ComponentAccessor
def customFieldManager = ComponentAccessor.getCustomFieldManager()
def createdDateValue = issue.getCreated()
def resolutionDate = issue.getResolutionDate()
def issueReportedDate = customFieldManager.getCustomFieldObject("customfield_17705")
def issueReportedDateValue = issue.getCustomFieldValue(issueReportedDate)
if (issueReportedDateValue != null) {
if (resolutionDate != null) {
def daysDiff = resolutionDate - issueReportedDateValue
return daysDiff
}
else {
def daysDiff = new Date() - issueReportedDateValue
return daysDiff
}
}
return null