Fix how we retrieve alerts by ID when recording maintenance record