Calendar calendar = Calendar.getInstance(); while (calendar.get(Calendar.DAY_OF_WEEK) != Calendar.MONDAY) { calendar.add(Calendar.DATE, -1); } currentWeekMonday = calendar.getTime().clearTime(); timeItems = issue.getFieldHistory("timespent").findAll({ it.created >= currentWeekMonday }); return timeItems.sum(0, { it.from ? it.to.toInteger() - it.from.toInteger() : it.to.toInteger() })/3600;Hi! I've created JMCF duration field and used groovy formula to estimate amount of time spent during current week. When testing the formula in field configuration everything works fine, but on issue page the field shows zero, like the script is not executed of something. What am I doing wrong?