If I cast a Glyph of Warding spell on the ground and set the activation to a creature such as an Oni or Doppelganger, will the trap still be triggered if the monster has polymorphed into something else?
It depends on the particular transformation. Anything along the lines of "Its statistics are the same in each form" like a Doppelganger's shapechange should trigger a glyph that targets Doppelgangers. On the other hand the polymorph spell literally turns you into a beast; you're no longer whatever creature type you used to be.
The shapechange spell declares that only alignment and Intelligence, Wisdom, and Charisma scores are still the same. That means that type and subtype shift as well. You've used it to change into a dragon and a guy runs at you with a Dragon Slayer you better run. Meaning that this can be used to bypass glyph of warding if it is set to "shapechangers" or "oni".
You may talk with your DM to cause it to trigger whenever a specific person/creature triggers it, if you for instance know the name of the Oni or Doppelganger. But then it would not trigger if any of their cronies touch the item.
The easiest way to make sure your glyph triggers to anyone but your partymembers. According to the spell; "You can also set conditions for creatures that don’t trigger the glyph, such as those who say a certain password.".
If I cast a Glyph of Warding spell on the ground and set the activation to a creature such as an Oni or Doppelganger, will the trap still be triggered if the monster has polymorphed into something else?
It depends on the particular transformation. Anything along the lines of "Its statistics are the same in each form" like a Doppelganger's shapechange should trigger a glyph that targets Doppelgangers. On the other hand the polymorph spell literally turns you into a beast; you're no longer whatever creature type you used to be.
The Forum Infestation (TM)
The shapechange spell declares that only alignment and Intelligence, Wisdom, and Charisma scores are still the same. That means that type and subtype shift as well. You've used it to change into a dragon and a guy runs at you with a Dragon Slayer you better run. Meaning that this can be used to bypass glyph of warding if it is set to "shapechangers" or "oni".
You may talk with your DM to cause it to trigger whenever a specific person/creature triggers it, if you for instance know the name of the Oni or Doppelganger. But then it would not trigger if any of their cronies touch the item.
The easiest way to make sure your glyph triggers to anyone but your partymembers. According to the spell; "You can also set conditions for creatures that don’t trigger the glyph, such as those who say a certain password.".
Subclass: Dwarven Defender - Dragonborn Paragon
Feats: Artificer Apprentice
Monsters: Sheep - Spellbreaker Warforged Titan
Magic Items: Whipier - Ring of Secret Storage - Collar of the Guardian
Monster template: Skeletal Creature