Using raycasts and triggers

I have my enemy using a raycast to test line of sight but it’s colliding with triggers that I have set up despite the layermask supposedly phasing these collisions out. If I remove the trigger aspect on the offending collider it does ignore that collision. I also know that I can remove all raycasts colliding with all triggers but I need that functionality elsewhere in my game. Is there any way to get this raycast to ignore a layer without making all raycasts ignore all triggers?

In case anyone is interested. User layers won’t work as masks for raycasts and triggers, but if you apply the Ignore Raycast layer to the trigger then it will ignore the trigger. Not sure why user defined layers won’t work but whatever.