From Sahih Bukhari (Hadith 2674):
Narrated Abu Huraira:The Prophet (ﷺ) asked some people to take an oath, and they hurried for it. The Prophet (ﷺ) ordered that lots should be drawn amongst them as to who would take an oath first
Reference: Bukhari 2674