Refactored slightly to allow for deduplication between `get_owned_repo_issues` and  `get_directly_assigned_issues`.