The actress will not return to Fox's 'Scream Queens' should the anthology be renewed for a third season.

Lea Michele has booked her next act.

The Glee and Scream Queens favorite has joined the cast of ABC's untitled city mayor comedy pilot, The Hollywood Reporter has learned.

From ABC Studios and Hamilton's Daveed Diggs, the project explores what happens when an outspoken, idealistic rapper named Courtney (Search Party's Brandon Micheal Hall) runs for office as a publicity stunt. When he actually gets elected, he surprises everyone (including himself) when he has a natural knack for the job and slowly transforms City Hall.

Details on the role Michele will play were not immediately available as the part is being adjusted to specifically accommodate the actress. The character originally was planned to be Courtney's chief of staff. It's unclear if that will remain as the part continues to shift with Michele's commitment to the project. The ABC comedy marks her first pilot since Fox's Glee and first series-regular role outside of the Ryan Murphy universe.

For Michele, meanwhile, this marks her follow-up to Fox's Scream Queens. The horror-comedy anthology from executive producer Murphy remains on the bubble and awaits word on its third season. Sources say Murphy released Michele from her deal for Scream Queens. Her casting does not have any bearing on if the series returns. Instead, it means her character of Hester is not going to be returning for a potential third season.

Jeremy Bronson (Speechless) will pen the script and exec produce the ABC Studios comedy alongside Diggs, Jamie Tarses, Scott Stuber and James Griffiths, with the latter set to direct the single-camera comedy.

Michele, whose credits also include New Year's Eve, is repped by WME and Untitled Entertainment.

Keep track of the latest news and castings at THR.com/PilotSeason and bookmark THR's handy guide.