Producers of Fox comedy ‘New Girl’ have revealed their plan for how to cope with lead actress Zooey Deschanel’s upcoming maternity leave, and they’ve landed a pretty sizeable name to temporarily replace her. Transformers star Megan Fox will be moving into the attic as part of a multi-episode arc during the new fifth season.

Essentially, since Deschanel's pregnancy was never part of the series' storyline, the producers will explain away Deschanel’s absence through a plot in which her character Jess is sequestered on jury duty for a time. At that point, Fox will move into the apartment for a while. She’s to play a character called ‘Raegan’, a “gorgeous, straight-shooting pharmaceutical sales rep who comes to town on business and shakes things up in the loft,” according to Fox’s press release.

Megan FoxMegan Fox will fill in for Zooey Deschanel on 'New Girl'

The role will constitute the 29 year old’s first regular TV role in nearly a decade. She was last seen on the small screen in ABC’s ‘Hope and Faith’, which wrapped after three seasons in 2006. Fox will be taking on the ‘New Girl’ part in addition to her commitments to the sequel to Teenage Mutant Ninja Turtles, and her first appearance will be in the sixth episode of the new season, which begins in January.

More: Megan Fox files for divorce from Brian Austin Green

“It’s insane to me that such a gorgeous person can be so funny, but I guess we just all have to accept it,” said ‘New Girl’s executive producer Liz Meriwether. “I’ve been a fan of her comedic skills since This Is 40, and I’m so excited to have her on the show. We had Megan in mind when we wrote this part – she’s the perfect person to come in and shake these guys up.”

Last month, 35 year old Deschanel gave birth to her first child, a baby daughter, and announced that she had secretly married her second husband Jacob Pechenik. Previously, she was married to Death Cab For Cutie lead singer Ben Gibbard between 2009 and 2011.

Also in August, Fox filed for divorce from her husband Brian Austin Green, with whom she has two children – Noah (2) and Bodhi (1).

More: Zooey Deschanel welcomes daughter, announces marriage to Jacob Pechenik