text: Scott Flynn flagged down a police car and told officers "I want the jail" after stealing a bottle of juice and smashing a window.
  Flynn was spotted putting two packages in his mouth at police headquarters in Dundee.
  He planned on taking the drugs into Perth Prison to pay off a debt.
  The 31-year-old claimed a gang said that he and family members would be "slashed" if he did not cooperate.
  Depute fiscal Eilidh Robertson told Dundee Sheriff Court that the packages contained almost 40g of heroin and just over 3g of cannabis resin.
  She said forensic officers had estimated the total maximum value of the heroin at £3,860.
  "However, if the accused had intended to resell these drugs once remanded to prison then the value could be as much as five times that," she said.
  Flynn admitted charges of theft, vandalism and being concerned in the supply of drugs on 8 November last year.
  Defence solicitor George Donnelly said: "Sometimes those who are in debt are told they have to work off that debt.
  "His work was to try to get these drugs in to Perth Prison.
  "He was advised graphically that if he didn't he and member of his family would be slashed.
  "They mentioned his sister and her baby, and his grandad who has dementia and cancer."
  Sheriff Alastair Carmichael told Flynn: "You committed two offences with the intent of being arrested and taken in to the prison sector in possession of heroin.
  "This is a serious matter."
target: A man who deliberately got arrested in an attempt to smuggle up to £20,000 worth of heroin into prison has been jailed for three years.