With 2x6 framing, you can only fit R-19 into the space if fibreglas is used and that will compromise ventilation.
Blue and pink foam is R3.6 per inch and some foil faced foam is R7 per inch. Wood is about R1 per inch and roofing or drywall is negligable.
I would place R19 fibreglas and add an inch of foil faced foam. That gets it to R 27 with the roof sheathing. Close enough- but if inspectors are strict there, you could add 1-1/2" of the foam. Tape it on the seams and you have a vapour barrier. apply it across the faces of the joists and it helps stop thermal bridging where the joist at six inches is only R6 right next to insulation at R19 or so.