Before issuing the writ, the court shall require a written undertaking on the part of the plaintiff, except a local government, with two or more sufficient sureties to be approved by the court, in a sum not less than double the amount claimed by the plaintiff if the amount is $1,000 or less or, if the amount claimed by the plaintiff exceeds $1,000, then in a sum equal to the amount. An undertaking may not be required in an amount exceeding the sum of $20,000. The condition of the undertaking must be to the effect that if the defendant recovers judgment or if the court finally decides that the plaintiff was not entitled to an attachment, the plaintiff shall pay all costs that may be awarded to the defendant and all damages the defendant may sustain by reason of the issuing of the attachment, not exceeding the sum specified in the undertaking.
§ 27-18-204, MCA