There are rules about advertising vacancies but I can't remember what they are.
I think, but not sure, that you have to give everyone the option to apply, but I'm not sure if that includes advertising internally.
A lot of organisations I've worked for advertise internally first, even if they want an external candidate. I'm not sure if that is just their policy or if they are compelled to do it.