The magnetic shape-memory effect is a consequence of the coupling between magnetism and structure in ferromagnetic alloys undergoing a martensitic transformation. In these materials large reversible strains can be magnetically induced by the rearrangement of the martensitic twin-variant structure. Several Heusler and intermetallic alloys have been studied in connec- tion with this property. In this paper we will focus on the Ni-Mn-Ga Heusler alloy which is considered to be the prototypical magnetic shape-memory alloy. After a brief summary of the general properties of this class of materials, we will present recent results of relevance for the understanding of the effect of magnetism on the martensitic transformation. Finally, we will discuss the requirements for the occurrence of the magnetic shape-memory effect.