An action, including an action for a writ of mandamus, alleging that an election officer violated a provision of this code while acting in the officer's official capacity may only be brought against the officer in the officer's official capacity.
Tex. Elec. Code § 31.130