When several actions are brought on one bond, undertaking, promissory note, bill of exchange, or other instrument in writing, or in any other case for the same cause of action against several parties, who might have been joined as defendants in the same action, no costs or disbursements shall be allowed to the plaintiff in more than one of such actions, which may be at his or her election, if the parties proceeded against in the other actions were, at the commencement of the previous action, openly within this state.