(b) Content. The affidavit shall fully and explicitly state whether the person detained is or has been in the custody of the person to whom the writ is directed, the authority and cause of the detention, whether custody has been transferred to another, and the facts of and authority for any such transfer. A copy of any mandate by virtue of which the person is detained shall be annexed to the affidavit, and the original mandate shall be produced at the hearing; where the mandate has been delivered to the person to whom the person detained was transferred, or a copy of it cannot be obtained, the reason for failure to produce it and the substance of the mandate shall be stated in the affidavit.