A word for one who is sacrificed or suffers so others need not

Although the word martyr somewhat applies, it includes a nobility not necessarily present.

An idiom describing this, in a voluntary situation, would be drawing the short straw, thereby acquiring some unpleasant or dangerous duty. An idiom for an involuntary situation would be getting thrown under the bus.

Context

Friend: I knew someone would eventually need to refactor this code. I didn't think it would be me.

Me: You're our... uh, what's the word?


patsy:

  1. a person who is easily cheated, victimized, etc
  2. a scapegoat

cannon fodder:

men regarded as expendable because they are part of a huge army

pawn:

a person, group, etc, manipulated by another