Every item has uncommon, rare and epic available... there's a ? mark on top left corner of the profession window that briefly explains what to do. You have to get all the 5 pieces in same color - 5 greens = 2 uncommon, 5 blues = rare, 5 purples = epic. You can lock up to 4 choices which will keep their colors even when you click the button to change colors. You have 3 tries to match the colors. So basically it's all about luck.
If you look closely, there's a little ? on the item you need to craft for the quest. If you hover your mouse over the item's 4 icons you will see uncommon, uncommon (2), rare and epic (from left to right). So by locking and changing the colors, you try getting 5 blues to make the rare item requested. You can always ask for more training mats from the profession npc, if you don't manage to get the rare quality with the first 20 mats given.