A jobsworth

Someone who uphold petty rules in their work, even at the expense of common sense

e.g. That traffic warden was such a jobsworth - I was one minute late back to the car and he insisted on giving me a parking ticket.