Alexander Andom was sent to a young offender institution over the incident in Harehills on December 18, 2020
Leeds Crown Court heard the victim was targeted in a park off Nowell Mount in the early hours of the morning.
He was sitting on a bench listening to music when he was approached by four men who had their faces covered.
One member of the group said to him: "What do you have with you?"
The attackers then began "patting him down" to check for valuable items.
One of the robbers slapped him and punched him in the face.
His iPhone, worth £500, was taken from him as well as a watch and a packet of cigarettes.
Another member of the gang took out a machete and ordered the victim to use his phone to log out of his iCloud so the device could not be tracked.
The robber raised the machete and the victim did what he was told through fear of being struck with the weapon.
He was also ordered to remove a diamond ear stud and hand it over.
A chain was then pulled from around his neck.
The victim saw a member of the public and ran to him for help.
They ran to the man's home nearby and contacted police.
Andom was arrested by police officers a short time later on Clifton Mount.
He was in possession of the victim's chain and a bag containing wraps of class A drugs.
The victim suffered a chipped tooth in the attack.
Andom, 19, now of Baldwins Lane, Solihull, pleaded guilty to robbery and two counts of possessing a class A drug.
Imran Khan, prosecuting, said Andom was aged 18 at the time of the incident.
Mr Khan said his client accepted that what he had done was wrong and that he was remorseful.
The court heard Andom has since moved to the Birmingham area in a being avoid people he had been committing offences with.
Judge Geoffrey Marson QC imposed an 18-month sentence.
He said: "This was a particularly serious robbery.
"You were part of a group in the early hours of the morning wearing disguises."