<P> The episode was written by Paul Lieberstein and Michael Schur, and was directed by Ken Kwapis . It was cut down from an hour and twelve minutes to forty - two minutes, making it the season's second hour - long episode after "A Benihana Christmas". Kwapis carefully shot Jim's reaction shots, as he did not want to reveal Jim's choice of Karen or Pam to the audience . The cast were unaware how the season would end, as multiple endings were shot by the crew . Filming wrapped up in April 2007 . </P> <P> The finale first aired in the United States on May 17, 2007 on NBC . An estimated 7.9 million viewers watched the episode; it earned a 3.9 / 12 ratings share among adults 18--49, making it rank first for the night . Television critics gave positive reviews to the finale . It won the Writers Guild of America Award for Best Screenplay--Episodic Comedy and the Primetime Emmy Award for Outstanding Single - Camera Picture Editing for a Comedy Series . In addition, Jenna Fischer received a nomination for Primetime Emmy Award for Outstanding Supporting Actress in a Comedy Series . </P> <P> Confident that he will get the corporate job in New York City, Michael Scott (Steve Carell) sells his condo and names Dwight Schrute (Rainn Wilson) his successor as Regional Manager . Pam Beesly (Jenna Fischer) cheerfully withstands her colleagues' teasing over her speech from "Beach Games," and tells Karen Filippelli (Rashida Jones) that she is not sorry about what she said but regrets putting Karen in an awkward position . Meanwhile, Kevin Malone (Brian Baumgartner) asks Jim Halpert (John Krasinski) whom he finds more attractive between Karen and Pam . Though Jim initially refuses to answer, he becomes intrigued when Kevin starts to compare the two women . He tells Kevin to keep thinking about it in a joking way, but appears to be very interested in the results . </P> <P> Jan Levinson (Melora Hardin) arrives at the office to win Michael back . In a panic, Michael consults the women of the office . Pam tells him not to reconcile with Jan . Michael attempts to reject Jan, but reverses himself immediately when he sees that she has had a breast augmentation . Jim and Karen drive to New York City together and spend the night before their interviews . Karen tells Jim that if either of them gets the job, both should move to New York . She promises to do so, but is met with awkward silence when she asks Jim to reciprocate . Meanwhile, Dwight begins his new regime, assigning Andy Bernard (Ed Helms) the role of his number two and asking Pam to be his secret "Assistant to the Regional Manager ." Dwight's new motivational style is not popular, and so he and Andy repaint the walls of Dwight's new office black in order to instill fear . </P>

Who got jan's job in the office