I don’t think there’s a built-in way to get the published scan of the
previous build, but you can get the one of the
current build right after it’s published with
buildScanPublished. Then you could write a log of published scans somewhere and create
lastPublishedScans