A man stood on the day of Conquest (of Mecca) and said: Messenger of Allah, I have vowed to Allah that if He grants conquest of Mecca at your hands, I shall pray two rak'ahs in Jerusalem. He replied: Pray here. He repeated (his statement) to him and he said: Pray here. He again repeated (his statement) to him. He (the Prophet) replied: Pursue your own course, then. Abu Dawud said: A similar tradition has been narrated by 'Abd al-Rahman b. 'Awf from the Prophet ﷺ.
يَا رَسُولَ اللَّهِ إِنِّي نَذَرْتُ لِلَّهِ إِنْ فَتَحَ اللَّهُ عَلَيْكَ مَكَّةَ أَنْ أُصَلِّيَ فِي بَيْتِ الْمَقْدِسِ رَكْعَتَيْنِ قَالَ صَلِّ هَا هُنَا ثُمَّ أَعَادَ عَلَيْهِ فَقَالَ صَلِّ هَا هُنَا ثُمَّ أَعَادَ عَلَيْهِ فَقَالَ شَأْنَكَ إِذًا