Daniel Mark Williams (left), 29, of no fixed abode, appeared at Cardiff Crown Court along with Kaine Peterson (right), 21, of Lime Crescent, Newport.
Both men admitted the offence which was committed in Cwmbran on Thursday 13 August.
Williams received a 36-month sentence after admitting the offence of concerned in the supply of a controlled class A drug, while Peterson was handed a 32-month term