We are usingbelow code to get Issue agein JIRA 7.3.6
DateUtils.getDurationString(((new Date().getTime() - issue.getCreated().time) / 1000) as Long)
output looks like 20w 3h 23m
is there anyway we can get only days.
import com.atlassian.core.util.DateUtils import com.atlassian.jira.component.ComponentAccessor def issue = ComponentAccessor.getIssueManager().getIssueObject('CIT-8991') def x = Math.ceil(new Double((((new Date().getTime() - issue.getCreated().getTime())/(1000*24*3600)))))
Hope this helps
I've tried your answer in JIRA 6.3.6. Encountered an error as "Cannot invoke method getCreated() on null object" Can you please suggest how to get rid off this one. I'm using the same script that you've given above. Let me know if something need to get modify in the script.
See how to use Jira on the go! Demo Den Episode 5 is here: meet Jira Mobile with Jira Product Manager Rayen Magpantay. Demo Den is in our monthly series where a Jira PM demonstrates...
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