I have two date/time fields ("Actual Start" & "Actual End"). Want I want to do is have a scripted field which is the time difference between these 2 dates / time.
So far I've only been able to get an integer response which is representing the days but I need this displayed in minutes / hours etc.
Any help would be appreciated as I’m stuck :(
It's not written for your exact situation, but this script should return a calculated 'Date' value:
def customFieldManager = ComponentAccessor.getCustomFieldManager();
def dateFieldObject= customFieldManager.getCustomFieldObjectByName(
def dateFieldObject2= customFieldManager.getCustomFieldObjectByName(
(issue.getCustomFieldValue(dateFieldObject) && issue.getCustomFieldValue(dateFieldObject2))
def dateValue= issue.getCustomFieldValue(dateFieldObject) as Date
def dateValue2= issue.getCustomFieldValue(dateFieldObject2) as Date
dateValue - dateValue2
Let me know if you had something else in mind, or if you need help getting it to work for your exact situation. :)
I didn't know the epoch time was in milliseconds, I was getting this value but didn't realise it was milliseconds.
I have converted this using the link below and I know get the required breakdown of the time difference.
Hi community 👋, as every Monday we're bringing you a quick update on what happened in the Atlassian ecosystem last week. There were a few interesting events like for example the announcement of th...
Connect with like-minded Atlassian users at free events near you!Find an event
Connect with like-minded Atlassian users at free events near you!
Unfortunately there are no Community Events near you at the moment.Host an event
You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events