def METHOD_NAME(cls, serial_number):
    ms = MachineSnapshot.objects.select_related("source").filter(serial_number=serial_number,
                                                                 source__name="jamf").order_by("-id").first()
    if not ms:
        logger.warning("No Jamf machine snapshot found for serial number %s", serial_number)
        return
    try:
        instance = JamfInstance.objects.get(**ms.source.config)
    except JamfInstance.MultipleObjectsReturned:
        logger.warning("Multiple JamfInstances found for serial number %s", serial_number)
    except JamfInstance.DoesNotExist:
        logger.warning("No JamfInstance found for serial number %s", serial_number)
    else:
        return getattr(instance, instance_attr, None)