Whenever an action is brought against a person for any of the causes specified in ORS 30.510(1), the district attorney, in addition to the statement of the cause of action, may separately set forth in the complaint the name of the person rightfully entitled to the office or franchise, with a statement of the facts constituting the right of the person thereto. In such case, judgment may be given upon the right of the defendant, and also upon the right of the person so alleged to be entitled, or only upon the right of the defendant, as justice may require.
ORS 30.530