Use this Command in a repeat. Command Block(1.13+)

    /execute as @a[nbt={Inventory:[{Slot:102b,id:"minecraft:iron_chestplate"}]}] run replaceitem entity @s armor.chest minecraft:chainmail_chestplate 1

However this will only work once the Iron Chestplate is placed on the player's armor slot.