Hi,
We are usingbelow code to get Issue agein JIRA 7.3.6
import com.atlassian.core.util.DateUtils
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.
Thanks,
Ashish.
Hey Ashish,
Try this
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
Regards
Chander
Thank you Chander it worked.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Is it possible to exclude the weekends?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
No, please do let us know if u figured it out
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Chander,
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.
Thanks,
Naresh
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Your code is not getting an issue. You will need to fix that.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Join the largest European gathering of the Atlassian Community and reimagine what’s possible when great teams and transformative technology come together. Plus, grab your Super Fan ticket now and save over €1,000 on your pass before prices rise on 3 June.
Register nowOnline forums and learning are now in one easy-to-use experience.
By continuing, you accept the updated Community Terms of Use and acknowledge the Privacy Policy. Your public name, photo, and achievements may be publicly visible and available in search engines.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.