BOSTON — The Yankees traded for Sonny Gray a year ago and J.A. Happ last week, both times in hopes of improving their rotation. On Thursday, before their most important series of the season, Gray found himself bumped to the bullpen and Happ landed on the disabled list.

And because Luis Cessa was needed in Thursday’s 15-7 loss to the Red Sox, they’ll need a starter on Saturday when Cessa was supposed to take Happ’s spot, with Lance Lynn taking Gray’s spot Monday versus the White Sox.

While the Yankees hope Happ will miss just one start after going on the 10-day disabled lis0t with hand, foot and mouth disease, for Gray, it’s the low point of what has been a hugely disappointing tenure with the Yankees.

The final straw came Wednesday against the horrid Orioles, as Gray gave up seven runs in 2 ²/₃ innings, the third time in his last six outings the right-hander failed to survive even three innings.

“We just talked about it a lot after the game [Wednesday],” Aaron Boone said before Thursday night’s game. “We came away with that decision and cemented it [Wednesday] night that that was the way we wanted to go. We think it’s the best thing for everyone involved right now.’’

Gray, who said Wednesday he hoped to remain in the rotation but would understand any move the Yankees made, made it clear he was willing to help in relief and would be available Saturday.

But he also expects to start again.

“I don’t think my days as a starting pitcher in this league are over,’’ Gray said. “I think at this moment and right now, the thought is to have me go to the bullpen and see what happens. Whether it’s this year, next year or down the road, I truly picture myself as a starter in this league. It’s all about winning right now this season and doing my part.”

Gray arrived shortly before last year’s non-waiver trade deadline from Oakland and has been disappointing from the beginning.

His continued inability to pitch deep into games as well as the acquisition of Lynn last week from Minnesota were the determining factors in the switch, according to Boone.

General manager Brian Cashman admitted Gray hasn’t responded well to pitching in New York.

“We haven’t been able to get out of him, in this environment, what he’s capable of,’’ Cashman said on the YES Network. “And that’s something I would be responsible for.”

Cashman said he received trade interest on Gray, but said teams wanted to “buy low.”

Boone hasn’t given up on Gray, who pitched well in his three previous outings prior to Wednesday.

“He’s been a very good starting pitcher, he’s 28 years old and the stuff we see really each outing would suggest he’s more than capable,’’ Boone said.

Not having Happ for at least a start also stings, especially because of the lefty’s success against the Red Sox was among the reasons the Yankees picked him up from Toronto.

But his diagnosis of hand, foot and mouth disease turned out not to be as mild as the Yankees first believed. Boone said Happ’s blistering hadn’t subsided, which indicated the virus was still in his system.

Noah Syndergaard of the Mets missed just one start with the same condition and the Yankees believe that will be the case with Happ.

As for Saturday, Boone said they he didn’t think the starter would come from the current staff. Chance Adams would be in line to fill in, because he is due to start for Triple-A Scranton/Wilkes-Barre on Saturday.

“We’ll consider all options,’’ Boone said. “We’ll have to see how it all lines up.”

Just as worrisome is Gray’s status.

Pitching coach Larry Rothschild tried to paint a positive light on the switch.

“He is a starting pitcher,’’ Rothschild said. “He’s proven that. He just has to be more consistent. Maybe not having to prepare for four or five days and just going out and throwing the ball will get him back to where we know he can be and this can be a minor bump in the road.”