Green’s Dictionary of Slang

duty n.

In phrases

do one’s duty (v.) [euph.]

to urinate, to defecate.

[US]H. Roth Call It Sleep (1977) 100: Step up close an’ do yer dooty, sonny me boy.
[UK]J. McDonald Dict. of Obscenity etc. 20: Business Shit [...] Other euphemisms comparable in their evasiveness include do one’s duty, take the dog for a walk.
[UK]E. McGorman Life in the French Foreign Legion 82: In certain regions of France [...] there is a propensity towards squat toilets. [...] Ordinarily you adopt a skier’s stance over the hole and try to maintain it until you’ve done your duty.