
755 S.W.2d 469 (1988)
Elwood A. BRIGHAM, Appellee,
v.
Larry LACK, Warden, and State of Tennessee, Appellants.
Court of Criminal Appeals of Tennessee, at Nashville.
April 22, 1988.
Permission to Appeal Denied July 25, 1988.
*470 L. Webb Campbell, II and Kelly M. Hundley, Nashville, for appellee.
Dean Hill Rivkin, Professor, University of Tennessee, Knoxville, amicus curiae (at trial).
W.J. Michael Cody, Atty. Gen. & Reporter, Gordon W. Smith, Asst. Atty. Gen., Nashville, for appellants.
Permission to Appeal Denied by Supreme Court July 25, 1988.

OPINION
BYERS, Judge.
This case originated from a pro se pleading filed in the Circuit Court by an inmate in custody of the Department of Corrections. The inmate alleged that the Board of Paroles had denied him release because he had not completed a treatment program for sex offenders and that when he subsequently attempted to enroll the Department of Corrections refused to classify him for the treatment program. He alleged these actions were arbitrary and prayed the court to declare his rights and grant appropriate relief.
It appeared the inmate's predicament arose from new legislation mandating the Department to develop a sexual abuse treatment program and making successful completion of the program a prerequisite to parole for sex offenders. See T.C.A. § 41-21-235 (Supp. 1986).
Although the pleading was styled "Petition for a writ of habeas corpus," it plainly did not allege grounds for habeas corpus relief. Over objection of the state, the court elected to treat the pleading as one for declaratory and injunctive relief under the general rule that "pleas shall be given the effect required by their content, without regard to the name given them by the *471 pleader," State v. Minimum Salary Dept. of A.M.E. Church, Inc., 477 S.W.2d 11 (Tenn. 1972).
Ultimately, after further briefing and a stipulation of facts, the trial court ruled that section 41-21-235 did not apply to this petitioner. The state took no position on this ruling and does not challenge it on appeal.
The trial court then entered an order 1) directing the Department of Corrections to admit the petitioner to the treatment program and to enable him to complete the program before his next scheduled parole hearing; and 2) prohibiting the Board of Paroles from denying parole on this ground if the Department had not complied. The order was stayed by this Court pending appeal.
The state appeals, saying that the trial court was without authority to treat the habeas corpus petition as an action for equitable relief and should have dismissed it; that the possibility of parole is not a protected liberty interest and triggers no due process rights, and the amended complaint failed to state a claim upon which relief could be granted; and, that after the stipulation of facts, summary judgment should have been granted to the state.
The petitioner raises the additional claim that the parole condition is an unconstitutional ex post facto law.
The mandatory and prohibitory injunctions issued by the trial court are vacated.
We conclude the trial court erred in treating this pleading as an action for equitable relief under the general rule.
Both respondents in this case are subject to specific procedural rules that limit judicial review of their actions.
First, the Department of Corrections is an agency of state government subject to the provisions of the Administrative Procedures Act, and judicial review of its application of a statute to an affected person is available only in the Chancery Court of Davidson County. T.C.A. §§ 4-5-223,  224. The Circuit Court had no jurisdiction to entertain an action against the Department concerning the applicability of a statute within its primary jurisdiction.[1] On this ground, the mandatory injunction against the Department is void.
Second, with respect to the complaint against the Board of Paroles, the trial court erred in considering events subsequent to its decision to deny parole in this case. T.C.A. § 40-28-115(c) provides, "The action of the [parole] board in releasing prisoners shall be deemed a judicial function and shall not be reviewable if done according to law." At most, the pleading could be viewed as a petition for common law writ of certiorari.[2]See Fallin v. Knox County Board of Commissioners, 656 S.W.2d 338 (Tenn. 1983) (zoning case filed under certiorari procedure reviewed as action for declaratory judgment). Review is limited to the record of the Board proceedings and to issues of fundamental illegality.
On this record the only issue that could be reached was whether section 41-21-235 governed this petitioner's parole eligibility. Accordingly, the trial court's anticipatory order directed to the Board is vacated.
In light of our conclusions on the procedural matters, we do not reach the constitutional issues asserted by the parties.
WADE and REID, JJ., concur.
NOTES
[1]  We note that an amendment to the A.P.A. effective July 1, 1986, provides that a petition filed in an inappropriate court "shall be transferred to the appropriate court." T.C.A. § 4-5-322(b)(2) (Supp. 1987). The petition in this case was filed June 30, 1986.
[2]  The Board of Paroles is exempt from sections 4-5-223 and  224 of the Administrative Procedures Act. T.C.A. § 4-5-106(c).
