If the mortgagee or the mortgagee's assignee has commenced foreclosure by advertisement, the mortgagor, the mortgagor's successor in interest, or any other person claiming a lien, encumbrance, or recorded ownership interest in the real property that is the subject of the foreclosure, may require the owner and holder of the mortgage to foreclose by action and for that purpose shall present to the court having jurisdiction thereof an application describing the mortgage and stating the applicant's interest and stating why the mortgage should be foreclosed by action without necessity of stating any reasons, and upon such application the judge of such court shall, by an order to that effect, enjoin the mortgagee or the mortgagee's assignee from foreclosing such mortgage by advertisement, and direct that all further proceedings for the foreclosure be had in the circuit court properly having jurisdiction of the subject matter. For the purpose of carrying out the provisions of this section, service may be made upon the attorney or agent of the mortgagee or assignee.
SDCL 21-48-9