Hi!
Here you can get the ticket by bus direct from the Airport Madrid - Barajas Teminal 4 to Pamplona. https://www.alsa.es/
Once there you can get a bus from the main bus station of Pamplona to SJPP. Use to be a bus at 17.00h, to SJPP or maybe just to Roncesvalles... depends of the bus...