Police found a cannabis farm at a house in Lockwood when they were called to a domestic incident.
Leeds Crown Court heard no further action resulted from the original call but when they got into the property in Neale Road they found 52 cannabis plants at various stages of growth.
Martin Robertshaw, prosecuting, said at the time of the visit on November 29 last year, Jareese Judah Jackson was already under a suspended sentence for dangerous driving.
Growing equipment found included reflective tents and lighting and the search also revealed a quantity of dried cannabis which had already been harvested with a street value of £2,400, weighing scales and self-seal bags.
At the time Jackson claimed he had been growing the cannabis for his own use. He was then on bail on April 2 when he went to the address of his former partner in Dalton where he was not welcome.
During his visit he became abusive and at one stage picked up a bowl and struck her to the side of her temple with it.
Mr Robertshaw said both offences were in breach of the eight month prison suspended prison sentence imposed in August last year for dangerous driving. Jackson also had a previous conviction in 2012 for being concerned in the production of cannabis and possessing the drug with intent to supply.
John Bottomley, representing Jackson, said he was at the time a heavy cannabis user but the assault offence had brought it home to him that he had a problem from using too much.
Mr Bottomley said: “It made him realise how dark things had got for him. He is deeply ashamed of what he did to his partner.”
As a result Jackson had since sought help from Lifeline in Huddersfield.
His phone was seized at the time of the cannabis discovery and there was no suggestion of drug dealing activity or a lavish lifestyle but he accepted he might have sold some of the extra cannabis produced.
Jackson, 34, admitted producing cannabis and common assault in breach of the suspended sentence and was jailed for a total of 44 months.
Deputy Circuit Judge James Spencer QC said the number of plants and quantity of cannabis found supported some commercial gain and his situation was aggravated by the assault while on bail.