Zhang Yue was exiled in 703 and recalled in 705, so this must have occurred during that period. See Old Book of Tang, vol.97 and New Book of Tang, vol.125.
That Zhang was a consultant at the legislative bureau was per his biography in the Old Book of Tang. His biography in the New Book of Tang indicated that he was a zuo shiyi (左拾遺) -- a consultant at the examination bureau (門下省, menxia sheng). Compare Old Book of Tang, vol.99 with New Book of Tang, vol.126.