Fig. as part of one's expected duties. When soldiers fight people in a war, it's in the line of duty.Police officers have to do things they may not like in the line of duty.
if you do something in the line of duty, or if something happens to you in the line of duty, you do it or it happens as a part of your job He was killed in the line of duty.