If the court ordering the discharge is not the court that ordered the commitment, then the court must transmit a certified copy of the order to the court that ordered the commitment. Upon receipt of the copy, the court that ordered the commitment shall enter an order finding that the person has been discharged by order of the court that issued the writ of habeas corpus.
T.C.A. § 52-3-504