The Office of the Judge (Kitab Al-Aqdiyah)
Dawud :: Book 24 : Hadith 3575
Narrated Ali ibn AbuTalib:
The Apostle of Allah (peace_be_upon_him) sent me to the Yemen as judge, and I asked: Apostle of Allah, are you sending me when I am young and have no knowledge of the duties of a judge? He replied: Allah will guide your heart and keep your tongue true. When two litigants sit in front of you, do not decide till you hear what the other has to say as you heard what the first had to say; for it is best that you should have a clear idea of the best decision. He said: I had been a judge (for long); or he said (the narrator is doubtful): I have no doubts about a decision afterwards.