The teams said Tuesday the swap must be completed by May 5.
A 25-year-old right-hander, Goody had a 4.66 ERA in 27 relief appearances for the Yankees this year, striking out 34 in 29 innings. He was a sixth-round pick in the 2012 amateur draft and was sidelined following reconstructive right elbow surgery in April 2013. Goody made his big league debut in July 2015 and pitched in seven games for New York that year.
He was designated for assignment Dec. 15 to open a roster spot needed when the Yankees completed their $86 million, five-year contract with free agent reliever Aroldis Chapman.