Go to File -> Preferences -> Tick "Automatically create unknown variables while pasting trigger data", go to the spell on the other map, right click and copy it, go into your map, right click and paste it.
For (v)Jass it's a bit different, you need to convert a new trigger into text (have the trigger selected and go to Edit (in the Trigger Editor) -> Convert to custom text. Copy the whole text code from the source (map or resource) and paste it in the code block of your map that you have just converted).