Hi Community, I have a problem regarding with the datetime field . I am using two datetime custom field. I also use this scripted field by scriptrunner, but it returns an error
I used Date Time Range Picker as a Searcher and a Custom Template :
$datePickerFormatter.withStyle($dateTimeStyle.DATE).format($value)
code:
import com.atlassian.jira.component.ComponentAccessor;
import com.atlassian.jira.issue.Issue;
import java.util.Date.*
def customFieldManager = ComponentAccessor.getCustomFieldManager();
def dateFieldObject= customFieldManager.getCustomFieldObject('customfield_10806');
def dateFieldObject2= customFieldManager.getCustomFieldObject('customfield_10807');
if(issue.getCustomFieldValue(dateFieldObject) && issue.getCustomFieldValue(dateFieldObject2)) {
def dateValue= issue.getCustomFieldValue(dateFieldObject) as Date
def dateValue2= issue.getCustomFieldValue(dateFieldObject2) as Date
return dateValue.getTime() - dateValue2.getTime() as Date
}
it says cannot return value of type long 2382000000 on method for java.util.Date. Thanks