27-28-304. Whose rights determined in judgment. Judgment may be rendered upon the right of the defendant and also upon the right of the person averred to be entitled, as provided in 27-28-302, or only upon the right of the defendant, as justice requires.