Keiron Hassan, 32, and Kamal Legall, 26, approached the victim outside a shop on Harris Avenue in Rumney. Hassan hit the man to the nape of the neck with the machete causing a five-inch-long cut and fractured vertebrae.
Legall stood over the man and shot him to the buttock causing a wound and fracturing his femur.
DNA evidence found on the shotgun, cartridges and in the vehicle used to drive away matched Kamal Legall.
Emergency services attended the scene and the victim was taken to the University Hospital of Wales where he had blood transfusions and hours of surgery to save his life.
Thomas Edwards of the CPS said: “This was a brutal attack in broad daylight with lethal weapons and could easily have resulted in the loss of life.
“The CPS presented strong, compelling evidence to the jury that both men were the ones responsible for the attack and tried to kill the victim, despite their denials.
“We hope the victim makes a good recovery from the serious injuries that were inflicted.”
Both men were sentenced to a total of 24 years’ imprisonment and ordered to serve a minimum of two-thirds of the sentence.