<Tr> <Th> Nationality </Th> <Td> American </Td> </Tr> <Tr> <Th> Based on </Th> <Td> Tim Canterbury </Td> </Tr> <P> James "Jim" Duncan Halpert (born October 1, 1978) is a fictional character in the U.S. version of the television sitcom The Office, portrayed by John Krasinski . The character is based on Tim Canterbury from the original version of The Office . The character is also named after a childhood friend of executive producer Greg Daniels . He is introduced as a sales representative at the Scranton branch of paper distribution company Dunder Mifflin, before transferring to the Stamford branch in the third season . Upon the merger of Scranton and Stamford branches, he becomes Assistant Regional Manager, and later co-manager alongside Michael Scott during the sixth season episode arc from "The Promotion" to "The Manager and the Salesman". After Dunder Mifflin is bought by Sabre Corporation, Jim is very briefly the sole regional manager of the branch, before returning to the Sales department until his requested termination in the series finale . </P> <P> His character serves as the intelligent, mild - mannered straight man role to Michael, although it is also defined by a rivalrous pranking on fellow salesman Dwight Schrute and a romantic interest in receptionist Pam Beesly, whom he begins dating in the fourth season, marries in the sixth, and has children with in the sixth and eighth . </P>

Who worked at the office first jim or pam