Jerusalem was under British Mandate control until 1947.
On November 1947 the Jordanian army together with Arab legion ocupied the east part of the city. the west part remain under the brithish control until the establishing of The State Of Israel in 1948.
The Jordanian were shoting on daily basis from East Jerusalem (in their control) to the West Jerusalem (in Israeli control).
Also, in 1949 Armistice Agreements Jordan promised to let the Jews pray in the Western Wall (the most holly place for Jews in the world) under their control in East Jerusalem. promise that they never fulfill.
In 1967 war ('Six Day War') Israel occupied East Jerusalem together with Samaria and Judah.
Since then united Jerusalem is the capital of Israel.