It was narrated from Ibn 'Umar, that 'Umar had vowed to spend a night in 'Itikaf during the Jahiliyyah. He asked the Messenger of Allah about that, and he ordered him to perform the 'Itikaf.
أَنَّهُ كَانَ عَلَيْهِ لَيْلَةٌ نَذَرَ فِي الْجَاهِلِيَّةِ يَعْتَكِفُهَا فَسَأَلَ رَسُولَ اللَّهِ ﷺ فَأَمَرَهُ أَنْ يَعْتَكِفَ