I have a need for a script that can return the difference in dates between the date an issue was due and the date it was resolved (the idea is to provide a measurement for delivery precision).
I have tried something like this:
def dueDate = issue.getDueDate();
def resolutionDate = issue.getResolutionDate();
if (resolutionDate == null) {return null;
}
return resolutionDate - dueDate;
The problem is that the (resolutionDate == null) gives an error since there apparently is a problem with the equals operator and the ingoing types of operands.
Yet, the code shows what I am trying to accomplish and I have tried different implementations but they all tend to generate a nullPointerException. The problem is that this is all there is in the log or the preview so I am stumbling in the dark.
Please, does anyone know how to accomplish this?