Section 20. Any civil action within the jurisdiction of the housing court department which is pending in another court department may be transferred to the housing court department by any party thereto.
Whenever cross actions between the same parties or two or more actions, including for the purposes hereof other department proceedings, arising out of or connected with the same housing accommodation are pending, one or more in the housing court department, the district court department, the probate and family court department, or in the superior court department, the chief justice of the housing court or the first justice upon motion of any party to any of such actions, may order that the action or actions pending in the district court department and in the probate and family court department and in the superior court department with all papers relating thereto, be transferred to the housing court department; and such action or actions shall thereafter proceed in the housing court department as though originally entered there.