The country formerly known, almost throughout history as Persia hasn't been known as 'Iran' until fairly recently. In 1935, it made the request of countries with which it had diplomatic relations, to henceforth call it "Iran".
From early in it's post-Persian history, Iran has had a turbulent past. In 1971, the western backed (I think his wife was an American) Shah of Iran, Reza Shah Pahlavi left Iran on the supposed basis of ill health. The exiled Ayatollah Khomeini returned a month later. The Islamic Republic of Iran was established later that year. Immediately, conflict and confrontation with the west began in earnest.
The Iran-Iraq war began in about 1979 and ended with a cease-fire in 1988 with no clear winner although both sides lost thousands of civilans and soldiers. So... Iran has not been involved in a "war" since it's recognition as "Iran", but fought to a draw the better armed and supplied (by the West) Iraq...