the court shall, without further petition or hearing, enter an order requiring the expungement of the court records. The court shall not automatically expunge such records in an unlawful detainer action where a judgement is entered in favor of the defendant; however, such a defendant may file a petition, and the court shall, without a hearing, expunge such records in accordance with the provisions of subsection B.
Upon finding that the unlawful detainer action was dismissed and the 30-day period following such dismissal has passed or a nonsuit was taken and the six-month period following such nonsuit has passed, and no order of possession was entered, the court shall, without a hearing, enter an order requiring the expungement of the court records.
Va. Code § 8.01-130.01