Ypres 1916. The chance of war brings together two young officers with a fine sense of irony, a sergeant who was a printer in civvy street and an abandoned printing press. And so was born The Wipers Times ('Wipers', the Tommy's slang for Ypres), a monthly magazine satirising the situation in the trenches with ‘determined irony' and circulated to eager readers fighting on the frontline.

Newbury 2016. Private Eye's Ian Hislop and Nick Newman, natural heirs of Editor Captain Roberts and sub-Editor Lieutenant Pearson, triumphantly bring the story of The Wipers Times to the stage. They made it work wonderfully on film in 2013; now their play with music (composer Nick Green) makes the poignancy of finding gallows humour in the madness of the First World War all the more telling in the intimacy of the theatre's shared space.

Bookended with Roberts' lukewarm reception at a post-war Fleet Street job interview, the show is elegantly structured, wonderfully theatrical and perfectly paced by director Caroline Leslie and her cast of eight. Green's music makes for smooth transitions, the cast chorusing his superbly effective affectionate pastiche of those familiar First World War ditties as they change scene. Haunted by Steve Mayo's soundscapes, Dora Schweitzer's archaeological cross section of a trench evokes the miracle of managing everyday life and more in the cramped conditions below the mud and duckboards. The magazine's trademark spoof ads ('are you suffering from optimism?' – the cure is transfer to the Somme) translate triumphantly into music hall turns delivered with punch, framed in neon lights above the grimy reality of the trench.

James Dutton's quietly charismatic Roberts anchors it all, wide smiles breaking over his open face as he finds the funny in yet another absurd (usually dangerous) situation, inspiring confidence he doesn't feel as he leads his men over the top. George Kemp's Pearson is the perfect helpmeet, by turns topping the joke and playing the rueful comic stooge. Dutton is blessed with the perfect period face and everyone sports carefully-styled period hair (including facial!).

The complementary double act of Roberts and Pearson contrasts with a pair of high-command officers, Sam Ducane's perfectly humourless Lt Colonel standing for all the gung-ho officers who send men over the top, ignoring every reality check from Dan Tetsell's wisely perceptive General.

Kevin Brewer makes resourceful printer Henderson a delightfully reassuring presence. Peter Losasso and Jake Morgan are moving as teenage soldiers and Watermill favourite Eleanor Brown as all the women, morphs brilliantly from nurse to brothel madam.

After a genuinely gripping evocation of the hours leading up to the Armistice, the comedy climax is a demob happy song that like The Wipers Times – and Private Eye – leaves you thinking as you laugh.

The Wipers Times runs at the Watermill until 29 October and then tours to New Wolsey Theatre Ipswich (7 to 12 November) and Playhouse Salisbury (14 to 19 November).

Watch our interview with Ian Hislop and Nick Newman