If the plaintiff's action brought for any of the causes mentioned in this article, upon the trial thereon, is dismissed or the action fails to prove the plaintiff's right to the possession of the premises described in the complaint, the defendant shall have judgment and execution for his costs.
C.R.S. § 13-40-116
For dismissal of actions generally, see C.R.C.P. 41.