The story
Well attested during World War I. Attempts to find attestations that predate that war seem fruitless. The ambiguity of reference to a range of phenomena, from physical concussion due to the explosively loud noise of artillery fire (on both the sending and receiving ends) to psychological reactions to violence and maiming, was present in the term's use from the start. In 21st-century wars there is continued evidence that long, close exposure to the noise of artillery can cause traumatic brain injury even in soldiers who did not take incoming artillery fire. But most discussions of shell shock in World War I concerned combat stress as well.
Etymology from Wiktionary, CC BY-SA 4.0.