When an order is made by the superior court granting or denying a motion to change the place of trial, the party aggrieved by the order may, within 20 days after service of a written notice of the order, petition the court of appeal for the district in which the court granting or denying the motion is situated for a writ of mandate requiring trial of the case in the proper court. The superior court may, for good cause, and prior to the expiration of the initial 20-day period, extend the time for one additional period not to exceed 10 days. The petitioner shall file a copy of the petition in the trial court immediately after the petition is filed in the court of appeal. The court of appeal may stay all proceedings in the case, pending judgment on the petition becoming final. The clerk of the court of appeal shall file with the clerk of the trial court, a copy of any final order or final judgment immediately after the order or judgment becomes final.
Ca. Civ. Proc. Code § 400