The immediate cause of World War I that made the aforementioned items come into play (alliances, imperialism, militarism, nationalism) was the assassination of Archduke Franz Ferdinand of Austria-Hungary. ... When Russia began to mobilize due to its alliance with Serbia, Germany declared war on Russia.
WW1 was triggered by the assassination of the Austrian archduke, Franz Ferdinand and his wife, on 28th June 1914 by Bosnian revolutionary, Gavrilo Princip.