Lukasz Rogal, 40, of Union Street, was sentenced at Salisbury Crown Court on Friday (17/05) after pleading guilty to possession with intent to supply cocaine and heroin at an earlier hearing.
Rogal was also ordered to pay £228 surcharge.
Sergeant Charly Chilton said: “This is a case where the community have worked well with police. On April 12 plainclothes officers were targeting an area where we have had numerous reports of anti-social behaviour and drug use. While on patrol they witnessed what they believed to be a drug deal on Church Street and arrested Rogal.
“We know that drug dealing is something which causes great harm to our communities across Wiltshire and these drug dealers have no thought or regard to the misery they are creating.
If you have information about drug dealing or suspicious activity in your community please report it to us.
No matter how small the piece of information is, it will be recorded and used to build up a bigger intelligence picture that officers can then act on.