#It came about that

This phrase is used here to mark a new event in the story. (See: [[:en:ta:vol2:translate:writing_newevent]])

#the cupbearer

This is the person who brought drinks to the king.

#the baker

This is the person who made food for the king.

#offended their master

"upset their master"

#the chief cupbearer and the chief baker

"the leading cupbearer and the leading baker"

#He put them in custody in the prison of the captain of the guard

"He put them in the prison that was overseen by the captain of the guard"

#He put them

The king did not put them in prison but rather he commanded for them to be imprisoned. AT: "He had them put" or "He commanded his guard to put" (See: [[:en:ta:vol2:translate:figs_metonymy]])

#in the same prison where Joseph was confined

This can be stated in active form. AT: "This was the same prison that Joseph was in." or "This was the same prison Potiphar put Joseph"  (See: [[:en:ta:vol2:translate:figs_activepassive]])