You're on your way to the next level! Join the Kudos program to earn points and save your progress.
Level 1: Seed
25 / 150 points
Next: Root
1 badge earned
Challenges come and go, but your rewards stay with you. Do more to earn more!
What goes around comes around! Share the love by gifting kudos to your peers.
Keep earning points to reach the top of the leaderboard. It resets every quarter so you always have a chance!
Join now to unlock these features and more
The Atlassian Community can help you and your team get more value out of Atlassian products and practices.
Hi, how can I resolve the following?
running JIRA 6.4.7 and Scriptrunner 4.1.3.5
import com.atlassian.core.util.DateUtils def resolvedNames = ["Resolved", "Closed"] def timeDiff; if (issue.statusObject.name in resolvedNames) { timeDiff = issue.getResolutionDate().getTime() - issue.getCreated().getTime() } else { timeDiff = System.currentTimeMillis() - issue.getCreated().getTime() } DateUtils.getDurationString(Math.round(timeDiff / 1000))
Error -
image2015-12-10 12:5:49.png
You can probably just do a cast there:
DateUtils.getDurationString(Math.round((timeDiff / 1000) as Double))
Not exactly sure what's going on, but it's obviously having trouble inferring the type for "timeDiff / 1000".
It's safe to ignore the type checking information... https://scriptrunner.adaptavist.com/latest/jira/#_static_type_checking
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.