I am trying to have a custom field show how many days a issue has been open. I am using the script runner and created a script field. I am trying to find current date - created date for the days open. Here is the script
import com.atlassian.core.util.DateUtils
DateUtils.getDurationString(((new Date().getTime() - issue.getCreated().date) / 1000 / 3600 / 24 ) as long)
But the date is not showing up correctly.
I also want to exclude issue that are in a closed status here is what i have tried to add
import com.atlassian.core.util.DateUtils
def Status = issue.getStatusObject();
if (Status == Closed) {
return null;
}
DateUtils.getDurationString(((new Date().getTime() - issue.getCreated().date) / 1000 / 3600 / 24 ) as long)
but it comes back with an error of No such property: Closed for class: Script7* (* this number keeps growing when you press preview).
This is so i can use the field in a gadget on the dashboard.
What I can see that the "Estimate" field is empty. Do you have your estimation statistic set to story points for example and haven't actually added story points? In that case you won't see the completion bar...
Maybe turn your estimation statistic to issue count and see if that works?!
Cheers
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.