
841 A.2d 646 (2004)
Wayne Paul BURKETT, Petitioner
v.
Frederick K. FRANK, Superintendent, State Correctional Institution at Huntingdon, Nicholas Muller, Chairman, Pennsylvania Board of Probation and Parole, Attorney General Thomas Corbett, Blair County District Attorney's Office, Respondents.
Commonwealth Court of Pennsylvania.
Submitted on Briefs December 19, 2003.
Decided January 30, 2004.
*648 Wayne P. Burkett, petitioner, pro se.
Robert A. Greevy, Harrisburg, for respondent.
BEFORE: COLINS, President Judge, LEAVITT, Judge, and KELLEY, Senior Judge.
*647 OPINION BY President Judge COLINS.
Before the Court are the preliminary objections of respondents Frederick Frank and Nicholas Muller to the petition for review filed by Wayne Paul Burkett.
Burkett filed his petition for writ of habeas corpus in the Court of Common Pleas of Blair County in February 1997; the trial court docketed the petition under Burkett's 1982 criminal number. The petition avers that as a result of a habeas corpus action, the Third Circuit Court of Appeals ordered that his Blair County sentence be reduced by 39 months of delay chargeable to the Blair County Court. As a result, the Blair County court reduced his sentence, and he is currently serving a sentence of 12 years, 9 months to 28 years, 9 months. The petition avers that the Department of Corrections approved him for parole in June 1994 and that after an interview with the Board of Probation and Parole (Board) he was told that he would be released on parole on October 26, 1994 at the expiration of his maximum term. The petition avers that subsequently, in retaliation for Burkett's successful habeas corpus petition, the trial judge (Judge Thomas G. Peoples, Jr.) and the Blair County District Attorney wrote to the Board recommending that Burkett not be paroled without considering his prison adjustment, conduct, and rehabilitation.
The Board denied Burkett parole by decision recorded on September 15, 1994. Burkett's petition avers that he met all objective criteria for parole, that the Board had no legitimate or legal reason for denying parole, and that he is being held in violation of his constitutional rights based on the illegal, unfavorable recommendation of the Blair County District Attorney and sentencing judge. He characterizes the many reasons listed in the decision denying parole as pretextual. Burkett's petition requests relief in the form of release on parole, and an order enjoining the Board from refusing parole for impermissible reasons and barring all parties from retaliating against him.
After a hearing, the trial court (Judge Carson V. Brown, after Judge Peoples recused) granted the motion to dismiss filed by the Department of Corrections on the ground that habeas corpus is not available to a prisoner who is challenging the basis for denial of parole. Burkett appealed to Superior Court. In July 2001, the Superior Court transferred the appeal to Commonwealth Court, saying, "Because appellant's petition, although styled as a habeas corpus petition, complains of the Board's actions in denying him parole, the matter lies within the purview of the Commonwealth Court, which has exclusive jurisdiction over review of administrative parole orders." Upon receipt, this Court determined that this matter as originally captioned and pleaded was within our original jurisdiction and by order dated November *649 8, 2001, transferred the appeal to our original jurisdiction.
Respondents Frank and Muller filed two preliminary objections, one raising Burkett's failure to attach a copy of the writing upon which his claim is based in violation of Pa. R.C.P. No. 1019(i) and a demurrer. When ruling on preliminary objections in the nature of a demurrer, a court may sustain the objections and dismiss the case only when such relief is clear and there is no doubt that the law will not permit recovery. Stone & Edwards Insurance Agency, Inc. v. Department of Insurance, 151 Pa.Cmwlth. 266, 616 A.2d 1060 (1992). The court must accept as true all well-pleaded facts in the complaint and all inferences reasonably deducible therefrom. Id. A demurrer may not be sustained unless on its face the complaint shows that the law will not permit a recovery; all doubts must be resolved against sustaining the demurrer. Id.
Mandamus is an extraordinary remedy that is designed to compel the performance of a ministerial or mandatory duty and will not lie to compel a discretionary act. Weaver v. Pennsylvania Board of Probation and Parole, 688 A.2d 766 (Pa.Cmwlth.1997). To obtain relief, a petitioner must prove that he has a clear legal right to the relief requested, that the government body has a corresponding duty to grant the relief, and that he has no other adequate and appropriate remedy at law. Id.
Burkett here alleges that the Board had no legitimate or legal reason for denying parole, that parole was denied on the basis of the illegal unfavorable recommendation of the Blair County District Attorney and sentencing judge, and that the other reasons cited for denial of parole are pretextual. Although Burkett failed to attach a copy of the Board's September 15, 1994 decision denying him parole, he summarizes the reasons, and the court takes judicial notice that the decision, as attached to the Board's brief, states as follows:
The Board of Probation and Parole rendered the following decision in your case:
Refuse.
Open charges for new crimes, or new convictions, while serving this prison sentence.
Substance abuse.
Assaultive instant offense.
Very high assaultive behavior potential.
Victim injury.
Weapon involved in the commission of offense.
Your need for counseling and treatment.
Unfavorable recommendation from the District Attorney and sentencing judge.
Review in October, 1996.
You must continue to participate in sex offender treatment and any other prescribed programming.
You must maintain a clear conduct record.
You must earn an institutional recommendation for parole.
Mandamus will lie against the Board only if it has not followed the law or proper procedures in ruling on an application for parole. Weaver. That is not the case here. Section 19 of the law known as the Parole Act,[1] 61 P.S. § 331.19, mandates:
It shall be the duty of the board, upon the commitment to prison of any person whom said board is herein given the power to parole, to consider the nature *650 and circumstances of the offense committed, any recommendations made by the trial judge and prosecuting attorney, the general character and background of the prisoner, participation by a prisoner who is serving a sentence for a crime of violence ... in a victim impact education program offered by the Department of Corrections and the written or personal statement of the testimony of the victim or the victim's family.... The board shall further consider ... information regarding the nature and circumstances of the offense committed for which sentence was imposed as may be available. The board shall further cause the conduct of the person while in prison and his physical, mental and behavior condition and history, his history of family violence and his complete criminal record... to be reported and investigated. All public officials having possession of such records or information are hereby required and directed to furnish the same to the board upon its request and without charge therefore so far as may be practicable while the case is recent.
The Board properly considered the recommendations of the sentencing judge and district attorney, as well as the other factors cited, in denying Burkett parole. Moreover, even if Burkett could demonstrate that the recommendations of the sentencing judge and district attorney were based on improper motives, the Board's denial of parole would be proper based on the other reasons cited. "Mandamus cannot be used to say that an agency considered improper factors, that its findings were wrong, or that the reasons set forth in its decision are a pretense." Weaver, 688 A.2d at 777.
To the extent that Burkett's petition can be construed as attempting to state a claim against Frank and/or Muller for retaliation, although parole is discretionary, a prisoner may properly state a claim under 42 U.S.C. § 1983 if a discretionary decision is made by reason of a prisoner's exercise of his constitutional rights. Buehl v. Horn, 761 A.2d 1247 (Pa. Cmwlth.2000), affirmed per curiam, 568 Pa. 409, 797 A.2d 897 (2002). In the present case, Burkett has failed to state a claim for retaliation against Frank, Muller, or the Board of Probation and Parole because he cannot establish on the facts alleged that he would have been granted parole "but for" the federal lawsuit he filed or, for that matter, that he would have been granted parole "but for" the unfavorable recommendations.[2]
Accordingly, the petition for review is dismissed as against respondents Frank, Muller, the Board of Probation and Parole, and the Attorney General.[3] Because the Blair County District Attorney remains as a respondent,[4] and no Commonwealth party remains, we transfer this matter to the Court of Common Pleas of Blair County for disposition in its original jurisdiction.

ORDER
AND NOW, this 30th day of January 2004, the preliminary objection in nature *651 of a demurrer, filed by respondents Frank, Muller, and the Board of Probation and Parole is sustained, and these respondents are dismissed.
Because the Commonwealth government is no longer a party, 42 Pa.C.S. § 761(a)(1), this matter is transferred to the Court of Common Pleas of Blair County in its original jurisdiction.
The Chief Clerk shall transmit the record and certify a photocopy of the docket entries in this matter to the prothonotary of the Court of Common Pleas of Blair County.
NOTES
[1]  Act of August 6, 1941, P.L. 861, as amended.
[2]  Because we sustain the respondents' demurrer, we need not address their objection to Burkett's failure to attach the writing upon which his claim rests, an amendable defect.
[3]  The petition for review alleges no claims against the Attorney General, and the Court assumes that Burkett included the Attorney General in his caption because an action against the Commonwealth government must be served upon the Attorney General in accordance with Pa. R.A.P. 1514(c). Even if the Court is wrong in its assumption, dismissal of the Attorney General is proper for the simple reason that not one of the petition's allegations or its request for relief mentions the Attorney General.
[4]  The Blair County District Attorney filed an answer, but no dispositive motion.
