From Sahih Muslim (Hadith 6246):
Abdullah b. Zubair reported:When it was the Day of the Battle of the Ditch I and 'Umar b. Salama were in the fort in which there were women, i. e. the wives of Allah's Apostle (ﷺ) ; the rest of the hadith is the same
Reference: Muslim 6246