The incident happened on Princess Elizabeth Way at around 9.25pm on Sunday, April 9.
The victim had been walking with friends when he was approached by two teenage boys wearing balaclavas.
One of the pair allegedly produced a samurai sword from his trousers and attempted to slash the victim.
They then allegedly chased the victim on an e-scooter, heading down Princes Elizabeth Way, towards Coronation Square, before he was able to evade them.
The boys were described as being white, aged about 15, and wearing black clothing and balaclavas.
Officers would like to speak to anyone who has any footage or who may have witnessed two boys in black clothing riding an e-scooter between 8pm and 10pm that night.
Two boys aged 16 and one aged 14, all from Cheltenham, have been arrested on suspicion of attempted grievous bodily harm.
They have been released on bail pending further enquiries.
Police are asking anyone with any information about this incident to contact them.
Information can be provided by completing an online crime information form on the Gloucestershire police website by quoting 358 of April 9.