Depending what the job was, the US may or may not have already finished it. If the job was simply toppling a dictator, then the task was completed. If it was setting up a democracy, the job was impossible without the will of the people. If it was bringing peace to the country, this too was impossible without the will of the people absent a legitimate occupation force akin to the days of colonialism. Clarify what job the US should have finished and perhaps a more clear answer can be articulated.
The mistake that Barack Obama made in regards to his Iraq policy was to leave the country without a sable government and military in place. By leaving to soon the government was not mature enough to defend itself and eventually became a breeding group for Islamic Terrorist and the group ISIS.
I think the US did a decent job at getting the Iraq government on its feet, and even gave them advice on how to carry out a democratic society. We left them with that. If we stayed and held their hands, they would have never gained the experience that is needed to be able to defend their own country. We did the job and got out; the way it should be.
We never had a clear goal in Iraq, and that showed in the results. Staying there just would have created even more hate for America and the West in general, and likely prompted more terror attacks. If we are going to go after terrorist groups, we have to target exactly where they are and form a coalition with local governments to take them down.