1 Chronicles 25:8-9

ISV(i) 8 Their duties, whether significant or insignificant, whether performed by teacher or pupil alike, were assigned by lottery.
9 Asaph’s first lottery was cast in favor of Joseph; the second went to Gedaliah, that is, to him, to his relatives, and his sons, for a total of twelve;