Were you shifting at the time? Were you pedalling hard? What gear were you in on the cassette? How many miles on the bike?
I assume it was stuck between the smallest chainring and the chain stay (not really the BB). This is obviously bad for the frame. It may be a mechanical problem or a shifting technique problem or a combination of both.
Some possible causes for 'chainsuck':
1)Worn chain/chainrings.
2) Poor chainline. In addition to increasing the speed of
wear of the drivetrain, poor chainline will contribute to
chainsuck.
3) Mud and/or grit.
4) Bent teeth or 'burrs' on the chainring.
Since you bike is relatively new I would focus on #2 and #3. Since (I asssume) the bike is new, I would take it back to the shop and request that they check and/or re-adjust the drivetrain.