The Messenger of Allah ﷺ said, "If one of you needs to relieve himself and the prayer has been called, let him start with that."
حدثنا محمد بن الصباح أنبأنا سفيان بن عيينة عن هشام بن عروة عن أبيه
قال رسول الله ﷺ إذا أراد أحدكم الغائط وأقيمت الصلاة فليبدأ به
[Sahih] Reported by Abu Dawud in Kitab al-Taharah, chapter on whether a man may pray while holding back the urge to urinate, hadith no. 88, from the hadith of Hisham through this same chain. Tirmidhi, Ibn Khuzayma, Ibn Hibban, Hakim, Dhahabi, and others graded it sahih.