Oaths and Vows
كتاب الأيمان والنذور
It has a Shahid (supporting narration) from the Hadith of Kardam reported by Ahmad.
A man said on the day of the Fath, "O Messenger of Allah, I have vowed that if Allah opens the conquest of Makkah at your hands I shall pray in Jerusalem." He replied, "Pray here." He asked him again and he replied, "Pray here." He asked him again and he replied, "It's up to you, then."[Reported by Ahmad and Abu Dawud. al-Hakim graded it Sahih (authentic)].
The Prophet (ﷺ) said: "No (religious) journey is to be undertaken except to (pray in) the three mosques: The Sacred Mosque (Makkah), the Aqsa Mosque (Jerusalem), and this Mosque of mine (al-Madinah)."[Agreed upon, and the wording is al-Bukhari's].
[concerning his consultation with the Prophet] He said: I said: O Allah's Messenger (ﷺ), I made a vow in the Jahiliyya times to spend a night in devotion (I'tikaf) in the Sacred Mosque. He (the Prophet) said: "Fulfill your vow."[Agreed upon]. al-Bukhari added in another narration: "Then, spend a night in devotion (in the Sacred Mosque)."