Lees had been on electronically monitored bail for a few months when on February 13 he received a phone call from a friend behind bars at the Otago Corrections Facility.
He told the man he had constructed a "slamfire" weapon and had half a box of ammunition for use with it.
While discussing his upcoming domestic violence trial, Lees said his former partner would not show up for the hearing.
"Nah nah she won't because she knows I'll ... destroy her life if she does."
He added: "I will f... her up something chronic."
Within a fortnight, police raided Lees' home where they found the rudimentary firearm which had been put together using two pieces of pipe.
The weapon was capable of firing 12-gauge shotgun ammunition and officers found 10 such rounds in the same room.
"By its very nature, a firearm like this was unusually dangerous," Judge Tony Couch said.
"You also knew very well the weapon was illegal."
In August last year, the defendant was home with his then partner.
The pair began arguing early in the morning and Lees punched the woman in the face, causing her nose to bleed and swell up.
She later discovered it was broken, the judge said.
The woman requested the court impose a protection order in her favour but Judge Couch declined since he was satisfied the relationship was over.
He said the woman was welcome to apply to the Family Court to make such an order.
The judge also removed Lees' release condition which barred him from contacting the injured woman.
Lees, the court heard, had four previous convictions for firearms offences and two for violence.
He was jailed for six months but it is understood his release is imminent because of the time he spent locked up on remand.
The weapon and ammunition were formally forfeited.