
152 Wis.2d 308 (1989)
448 N.W.2d 274
Anna M. THRELFALL and Richard V. Baum, Plaintiffs-Appellants,
v.
TOWN OF MUSCODA, Defendant-Respondent.
No. 88-1265.
Court of Appeals of Wisconsin.
Submitted on briefs June 7, 1989.
Decided September 14, 1989.
*309 For the plaintiff-appellant the cause was submitted on the briefs of Anna M. Threlfall and Richard V. Baum, of Madison.
For the defendant-respondent the cause was submitted on the brief of Hoskins, Brown, Kalnins & McNamara, by Ivars Kalnins, of Lancaster.
Before Eich, C.J., Gartzke, P.J., and Dykman, J.
GARTZKE, P.J.
Anna Threlfall and Richard Baum appeal from a judgment dismissing their complaint against the town of Muscoda. The dispositive issue is whether the trial judge should have honored appellants' request for substitution of judge, sec. 801.58, Stats. 1985. We conclude the judge should have done so. We therefore reverse and remand for further proceedings.
The town attempted to widen a road dividing appellant's land. On October 7, 1986, appellants filed a complaint alleging that the town was trespassing on their land. They sought damages, a judgment declaring the width of the road, temporary and permanent injunctions enjoining the town from cutting trees or altering fences on their property, and a temporary restraining order pending the hearing on the temporary injunction. The request for a temporary restraining order was supported by Threlfall's affidavit. The judge to whom the case was assigned immediately granted the temporary restraining order on the basis of the affidavit. On October 7, 1986, appellants filed a notice to the town that their motion for a temporary injunction would be heard on October 10, 1986.
On October 9, 1986, appellants filed their request for substitution of judge. The named judge denied the request on grounds that it had been filed after the temporary restraining order had been granted and was therefore *310 untimely. The named judge tried the case without a jury, found against the appellants, and entered the judgment appealed from.
Section 801.58, Stats. 1985, provides in relevant part:
(1) Any party to a civil action or proceeding may file a written request ... with the clerk of courts for a substitution of a new judge for the judge assigned to the case. The written request shall be filed preceding the hearing of any preliminary contested matters....
(2) When the clerk receives a request for substitution, the clerk shall immediately contact the judge whose substitution has been requested for a determination of whether the request was made timely and in proper form. If the request is found to be timely and in proper form, the judge named in the request has no further jurisdiction and the clerk shall request the assignment of another judge under s. 751.03....[1]
We conclude that appellants' request for substitution was, in the words of the statute, "filed preceding the hearing of any preliminary contested matters." By the *311 time the request for a substitution was filed, the court had heard one preliminary matter: appellants' application for a temporary restraining order. While sec. 801.58, Stats., does not define a "preliminary" matter, it must include an application for interlocutory relief filed contemporaneously with the complaint. The statute reaches "preliminary matters where evidence is received which goes to the merits of the case." City of La Crosse v. Jiracek Cos., Inc., 108 Wis. 2d 684, 694, 324 N.W.2d 440, 445 (Ct. App. 1982). Threlfall's affidavit is not of record, but we infer it presented evidence going to the merits.
[1]
However, an ex parte temporary restraining order is not issued in a "contested" matter within the meaning of sec. 801.58(1), Stats. Issuing such an order is analogous to signing an order to show cause. The latter is not a preliminary contested matter. In Matter of Civil Contempt of Kroll, 101 Wis. 2d 296, 303, 304 N.W.2d 175, 178 (Ct. App. 1981). The trial court received evidence only from appellants. The town did not even have an opportunity to present contrary evidence.
The town argues that permitting substitution after an ex parte temporary restraining order is issued will encourage judge-shopping. This may be true, since the purpose of the "preliminary contested matter" limitation is "to disallow a party from `testing the waters' and then requesting substitution." Carkel, Inc. v. Lincoln Cir. Ct., 141 Wis. 2d 257, 265, 414 N.W.2d 640, 643 (1987). The statute nevertheless allows judge-shopping until the "preliminary contested matter" limitation applies.
[2]
Because appellants' request for substitution was timely, and because it is uncontested that it was in proper form, the named judge had no further jurisdiction. *312 Sec. 801.58(2), Stats. 1985. The clerk of courts must request assignment of another judge under sec. 751.03, Stats.
By the Court.Judgment reversed and cause remanded for further proceedings consistent with this opinion.
NOTES
[1]  Section 801.58(2), Stats. 1987, includes the following provision:

If the judge named in the substitution request finds that the request was not timely and in proper form, that determination may be reviewed by the chief judge of the judicial administrative district, or by the chief judge of an adjoining judicial administrative district if the judge named in the request is the chief judge, if the party who made the substitution request files a written request for review with the clerk no later than 10 days after the determination by the judge named in the request.
The amendment allowing the chief judge to review denials of substitutions was effective November 24, 1987, after appellants requested substitution. 1987 Wis. Act 68.
