This question already has an answer here:
My wife and I are entering Canada via UK in March. We have a valid Canadian immigration visa issued in our SA passports. We know we're exempt from a DATv as we're just in transit in London Heathrow for a few hours then heading on to Canada. We return to South Africa (again via London Heathrow) on 16 April 2018. Our Canadian visa would then have expired and we won't yet have our Canadian residency cards- only the confirmation of residency document (CoPR).
I have read blogs that state if you are flying FROM Canada, US, Australia or NZ via UK (and only in transit for less than 24hrs) within 6 months of having entered that country with a valid visa, you are exempt. I cannot find this clause on any gov.uk site and would like to read the official wording to be sure. Can anyone please confirm or share a link?