Ported 'ReplaceWithFirstOrDefaultIssue'.
Ported 'ReplaceWithLastOrDefaultIssue'.
Merge pull request #432 from TheCommieDuck/replace-with-first-or-default

Ported 'ReplaceWithFirstOrDefaultIssue' and 'ReplaceWithLastOrDefaultIssue'.