I use the below script to get the latest sprint but I would like to include a check which would display the value of latest sprint only if the sprint belongs to Active or Future Sprint.
ArrayList sprintList = (ArrayList)getCustomFieldValue("Sprint")
int numSprints = (sprintList != null) ? sprintList.size() : 0;
return (numSprints > 0) ? sprintList.get(numSprints - 1).getName() : ""
Please suggest on how I could achieve that.