Legislation relating to leaving the EU was passed by the Scottish Parliament and the National Assembly for Wales/ Cynulliad Cenedlaethol Cymru but has been referred to the Supreme Court by the Attorney General and the Advocate General for Scotland.
These two officers have the power to refer devolved legislation to the Supreme Court for a ruling on its constitutionality.
The UK Withdrawal from the European Union (Legal Continuity) (Scotland) Bill, and the Law Derived from the European Union (Wales) Bill were both passed on 21 March 2018. They contain similar provisions to the UK’s EU(Withdrawal)Bill, currently before Parliament, but (obviously) have significantly different approaches to which EU law will be retained and the processes by which it will be amended.