The court may refuse to render or enter a declaratory judgment or decree where such judgment or decree, if rendered or entered, would not terminate the uncertainty or controversy giving rise to the proceedings or for other sufficient reasons. The reasons for such refusal shall be stated in the record. The failure to exhaust administrative relief prior to bringing an action under section one shall not bar the bringing of such action if the petition for declaratory relief is accompanied by an affidavit stating that the practice or procedure set forth pursuant to the provisions of section two is known to exist by the agency or official therein described and that reliance on administrative relief would be futile. For the purposes of this section practice or procedure means the customary and usual method of conducting agency or official business.
Mass. Gen. Laws ch. 231A, § 3