Simon Foulkes was initially arrested on April 12 for shoplifting, and tested positive for Class A drugs.
He was told to return for a test on April 20, but failed to do so, and was arrested again to come back on April 27, - a date he also missed.
The court heard he received four weeks in prison, suspended for 12 months, for shoplifting, on April 10.
Tom Oates, mitigating, said: “Mr Foulkes has a long term history of Class A drug misuse, mainly heroin.
“He leads a fairly turbulent lifestyle and he does have difficulty keeping to dates. He hasn’t committed any new theft or drug offences.
“He is open enough to say he is still taking drugs but has been able to reduce that with a methadone prescription.
“He is not having to return to acquisitive crime because the methadone is working and he has a stable address.
“The purpose of the suspended sentence was to allow him to tackle the issues that lead to drug use. It would be unfair to activate it.”
Foulkes, 36, of Edingley Avenue, admitted failing to attend the Class A drug tests, when he appeared at Mansfield Magistrates Court, on Friday.
He was handed a 12 month conditional discharge, but was warned further offending would lead to him “going back inside”.
He was ordered to pay a £20 government surcharge, which will be added to the £1,692 he already owes the court.