The Glovers will face Bristol Rovers, Exeter City and West Ham Under-21s in Southern Group D of the 2018/19 Checkatrade Trophy.
Town were drawn against Rovers and City to reduce travel time for supporters with Darren Way's side guaranteed to play two of the three group stage fixtures at Huish Park.
With the Round One draw concluding on Wednesday 18th July, the Green & Whites were drawn to face West Ham Under-21s who were invited to compete in the competition by the EFL.
The Glovers will look to improve on last season's impressive run to the semi-final, where they eventually lost 1-0 to League One outfit Shrewsbury Town after defeating higher league opposition in the form of Plymouth Argyle, Wimbledon and Fleetwood Town.
Dates and ticket information will be confirmed in due course.