(a) If the defendant is a party to a pending action or special proceeding, the plaintiff may obtain a lien under this article, to the extent required to secure the amount to be secured by the attachment, on both of the following:
(1) Any cause of action of the defendant for money or property that is the subject of the other action or proceeding, if the money or property would be subject to attachment if the defendant prevails in the action or proceedings.
(2) The rights of the defendant to money or property under any judgment subsequently procured in the other action or proceeding, if the money or property would be subject to attachment.
(b) To obtain a lien under this article, the plaintiff shall file all of the following in the other pending action or special proceeding:
(2) A copy of the right to attach order.
(3) A copy of an order permitting creation of a lien under this article made by the court that issued the right to attach order.
(c) At the time of the filing under subdivision (b) or promptly thereafter, the plaintiff shall serve on all parties who, prior thereto, have made an appearance in the other action or special proceeding a copy of the notice of lien and a statement of the date when the notice of lien was filed in the other action or special proceeding. Failure to serve all parties as required by this subdivision does not affect the lien created by the filing under subdivision (b), but the rights of a party are not affected by the lien until the party has notice of the lien.
(d) For the purpose of this article, an action or special proceeding is pending until the time for appeal from the judgment has expired or, if an appeal is filed, until the appeal has been finally determined.