Shotguns as such were not often used as military combat weapons, lacking both range and power. When they have been used in recent times (WWI and after) they either did not have bayonets or were equipped with a rifle type bayonet. Examples are the Winchester 1897 and 1912 models, both of which were equipped with barrel jackets with bayonet lugs to take the Model 1917 bayonet.
While some may have been used in combat that way, especially in trench fighting, in my experience they were used mostly by MPs guarding military prisoners (not POWs, just stockade bums picking up trash or doing other useful work). I guess the shotgun combined with the bayonet would cause second thoughts in anyone planning to rush the guard.
Jim