If you want to challenge your immigration detention or other immigration related issues, you should use the form Petition for a Writ of Habeas Corpus under 28. To get a writ of habeas corpus, you must file a petition for a civil (not criminal) proceeding in either state or federal court.First, a U.S.C. § 2254 allows us to file a petition for Habeas Corpus when the client is in custody under sentence of a state court and is in a state prison. Notify the Clerk of the Court in writing if you change your address after filing your petition. Petition for Relief From a Conviction or Sentence By a Person in State Custody (Petition Under 28 U. S. C. § 2254 for a Writ of Habeas Corpus). Form:. Access to Forms​​ The Superior Court of Orange County offers several options to assist the public in completing court forms: To challenge your conviction, speak with an OC criminal defense lawyer about a Writ of Habeas Corpus at (714) 530-9690. Please complete the fields below to schedule a free consultation with a skilled attorney. Prison inmates can file a habeas corpus petition with the California Superior Court. The habeas petition is for situations when a legal error occurred, as we say, outside the "four corners" of the court file.