Bulugh al-Maram, Book 13, Hadith 1394 (English)

Narrated Jabir (bin 'Abdullah) (RA): 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)].

وَعَنْ جَابِرٍ ‏- رضى الله عنه ‏- { أَنَّ رَجُلاً قَالَ يَوْمَ اَلْفَتْحِ: يَا رَسُولَ اَللَّهِ! إِنِّي نَذَرْتُ إِنْ فَتَحَ اَللَّهُ عَلَيْكَ مَكَّةَ أَنْ أُصَلِّيَ فِي بَيْتِ اَلْمَقْدِسِ, فَقَالَ: "صَلِّ هَا هُنَا".‏ فَسَأَلَهُ, فَقَالَ: "صَلِّ هَا هُنَا".‏ فَسَأَلَهُ, فَقَالَ: "شَأْنُكَ إِذًا" } رَوَاهُ أَحْمَدُ, أَبُو دَاوُدَ, وَصَحَّحَهُ اَلْحَاكِمُ 1‏.‏ ‏1 ‏- صحيح.‏ رواه أحمد ( 3 / 363 )‏، وأبو داود ( 3305 )‏، والحاكم ( 4 / 304 ‏- 305 )‏ بسند على شرط مسلم كما قال الحاكم.‏

sunnah.com

also referenced under: Book 13, Hadith 21 (In-Book)