Zayd bin Arqam reported,

Ali bin Abu Talib, while he was in Yemen, was brought a case involving three men who had all had relations with the same woman during a single period of purity. He asked two of them, "Do you both acknowledge this child as belonging to him?" They said, "No."Then he asked another two, "Do you both acknowledge this child as belonging to him?" They said, "No."Each time he asked two of them, "Do you both acknowledge this child as belonging to him?" they said, "No."So he drew lots between them and assigned the child to the one whose lot was drawn, and he required him to pay two-thirds of the blood-money. This was mentioned to the Prophet ﷺ, and he laughed until his back teeth showed.

Ibn Majah 2348

Daif

حدثنا إسحق بن منصور أنبأنا عبد الرزاق أنبأنا الثوري عن صالح الهمداني عن الشعبي عن عبد خير الحضرمي

عن زيد بن أرقم قال

أتي علي بن أبي طالب وهو باليمن في ثلاثة قد وقعوا على امرأة في طهر واحد فسأل اثنين فقال أتقران لهذا بالولد فقالا لا ثم سأل اثنين فقال أتقران لهذا بالولد فقالا لا فجعل كلما سأل اثنين أتقران لهذا بالولد قالا لا فأقرع بينهم وألحق الولد بالذي أصابته القرعة وجعل عليه ثلثي الدية فذكر ذلك للنبي ﷺ فضحك حتى بدت نواجذه

ابن ماجه 2348ضعيف
Contents
Reference
Commentary
Ayat
Collection
Sunan Ibn Majah
Book
Rulings
Chapter
Judging by drawing lots
Numbering
Darussalam 2348
Ibn Majah 2348