I've been going through all of the questions and resolutions for creating a field using Scriptrunner to calculate the number of days an issue has been opened.
I'm a novice at scripting so some of the resolutions have not made sense to me.
Here's what I've tried:
First attempt:
import com.atlassian.core.util.DateUtils
DateUtils.getDurationString(((new Date().getTime() - issue.getCreated().time) / 1000) as Long)
Which returns with the format of w d h m
example from one of my issues 31w 2d 12h 33m
Second attempt:
import com.atlassian.core.util.DateUtils
DateUtils.getDurationString(((new Date().getTime() - issue.getCreated().time) / 86400000) as Long)
Which returns as Months
I just need to get days only for my customer - again I'm new at scripting and have been researching this, not finding any recommendations that lead to just days. If there is a rounding that needs to be done to this script or a completely different script - please give me the steps.
Thank you fellow Atlassian Folks!