in the line of duty
in the line of duty {adj. phr.}
Done or happening as part of a job.
The policeman was shot in the line of duty.
The soldier had to clean his rifle in the line of duty.
Categories:
Source: A Dictionary of American Idioms