It is Aarne-Thompson type 870, the entombed princess.
Once there was a princess named Maid Maleen who fell in love with a prince, but her father refused his suit. When Maid Maleen said she would marry no other, the king had her and her servants locked up in tower, with food that would be enough to feed them for seven years.
After seven long years, the food eventually ran out, but no one came to release them or deliver more food. The princess and her servants then decided to escape from the tower using a simple knife. When they finally managed to break free of the tower, they found the kingdom destroyed and the king long since gone. Without knowing where to go, they finally arrived at the country of Maleen's lover, and sought work in the royal kitchen.
Since Maleen's imprisonment, the prince had been betrothed by his father to another princess. This princess, lacking of confidence in herself, did not think that she would be good enough for the prince. Thus, she would not leave her room and let him see her. On her wedding day, not wishing to be seen, the princess sent Maid Maleen in her place. At the wedding, the prince put a golden necklace around Maid Maleen's neck as proof of their marriage. Later that night, the prince went to the wedding chamber where the princess was waiting, but he did not see the golden necklace around her neck. Immediately, he knew that the princess was not the one he was married to. Meanwhile, the princess had sent out an assassin to kill Maid Maleen. The prince, who left the wedding chamber to look for his true bride, was guided by the shine of the golden necklace and came in time to save her. With the golden necklace as the proof of marriage, they were married and lived happily ever after!
The motif of the tower imprisonment, as in Rapunzel, is here only as a prison, and while they work in a kitchen, as in Catskin or Katie Woodencloak, the contempt springs only from the false bride.
In other variations of type 870, the false heroine's motive to substitute the heroine for herself is not ugliness, but to conceal that she is pregnant, as in Little Annie the Goose-Girl or Gil Brenton. In either variant, the false bride is unusual in that she stands in no relationship to the real one. In many more fairy tales, the true bride's place is taken by her sister or stepsister.