Yes. It looks at what is in the same PNR.
If you hold a visa or permanent resident, these can be pre-entered into the PNR, online if the airline supports such functionality (some do, most don't), by airline staff, or if you have a travel agent that knows how to do it, they can enter it too.