When exporting contacts using custom selected fields, results in "Undefined Index ...Mapping.php Line 622"
This is a bug, albeit a minor one because of the simple workaround.

In PHP (the language most of CiviCRM is written in), there are various levels of problem: notice, warning, error, etc.  A notice generally means, "This software's code has something ambiguous but not wrong about it.  We're going to infer what the code's author meant to do, but they may want to make it explicit."  

Good software strives to be notice-free, and CiviCRM is mostly notice-free.  You've discovered an exception - though you haven't noted your CiviCRM version, so it's quite possible this is already fixed.

The reason this is less important than many other bugs is that notices should be suppressed on a live instance of CiviCRM - they should only really pop up if you're a developer.  So the fix for this is to change your PHP settings to hide notices.  This issue should go away after that.  There's a few ways to disable notices; this Stack Exchange answer outlines them: https://stackoverflow.com/questions/2867057/how-do-i-turn-off-php-notices