Dear Community,
I have a field that calculates the difference between two dates:
import com.atlassian.jira.component.ComponentAccessor;
import com.atlassian.jira.issue.Issue;
import com.atlassian.jira.util.*
import java.util.Date.*
def customFieldManager = ComponentAccessor.getCustomFieldManager();
def dateResponse = customFieldManager.getCustomFieldObjectByName('Date of First Response');
if(issue.getCustomFieldValue(dateResponse) && issue.created)
{
def dateValue= issue.getCustomFieldValue(dateResponse) as Date
def dateValue2= issue.created
def dif = dateValue.getTime() - dateValue2.getTime()
return dif
}
I want to display value of this field in format: "XX Days YY Hours ZZ Minutes QQ Seconds"
Anyone can help me out?
Thanks in advance.