(a) Application for jury trial.--After service of the complaint in divorce or annulment on the defendant in the manner prescribed by general rules or entry of a general appearance for the defendant, if either of the parties desires any matter of fact that is affirmed by one and denied by the other to be tried by a jury, that party may take a rule upon the opposite party, to be allowed by a judge of the court, to show cause why the issues of fact set forth in the rule should not be tried by a jury, which rule shall be served upon the opposite party or counsel for the opposite party.
(b) Disposition of application.--Upon the return of the rule, after hearing, the court may discharge it, make it absolute or frame issues itself. Only the issues ordered by the court shall be tried. The rule shall not be made absolute when, in the opinion of the court, a trial by jury cannot be had without prejudice to the public morals.