Photo: The CW

Get ready for another key change on Crazy Ex-Girlfriend. After her suicide attempt at the end of last week’s episode, Rebecca Bunch takes a cheerier outlook in this number, “A Diagnosis,” from the upcoming episode, “Josh Is Irrelevant,” where her new doctor — hot Dr. Shin (Jay Hayden) — says that he has a new medical diagnosis for her condition. Cue a big Broadway belter.

“Earnestness is scary to me sometimes in writing because it runs the risk of being cheesy, and also you’re really baring your soul without hiding it with snarkiness. It feels very exposed,” said Rachel Bloom who co-wrote the episode with Aline Brosh McKenna and Ilana Peña. “‘Diagnosis’ is pretty earnest. I mean, it’s still funny and you’re getting in her headspace, which is specific, but because you run the risk of it being cheesy, it’s still scary for me. It comes from a place of truth and that feels great for me.”

Bloom started by writing the lyrics and a rough melody, which Adam Schlesinger then filled out with chords and a full melody. Jack Dolgen suggested they move it up half a key and voilà: an inspirational modern musical number à la Dear Evan Hansen.

“I’m the biggest musical-theater fan of the people who write songs on this show,” Bloom continued. “I rely on the other people around me to be like, ‘This is cheeseballs.’ The fact that Aline doesn’t think it’s cheeseballs and Adam didn’t think it’s cheeseballs and Jack doesn’t think it’s cheeseballs is good.”

“Everyone has their own cheese-o-meter,” added Aline Brosh McKenna. “It’s a hopeful song and it makes me cry.”