DVCS only lists public repositories in org
Platform notice: Server and Data Center only. This article only applies to Atlassian products on the Server and Data Center platforms.
Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.
*Except Fisheye and Crucible
Summary
DVCS only lists public repositories in org
Github private repos not showing in the DVCS account. No errors were encountered or logged in the logs.
Environment
Jira 8.14+
Diagnosis
Visit Jira Admin -> Logging and Profiling, and add logging for package com.atlassian.jira.plugins.dvcs , DEBUG level. Refresh the repositories in the organization and capture logs.
org.eclipse.egit.github.core.client.RequestException: Although you appear to have the correct authorization credentials, the `<organization_name>` organization has enabled OAuth App access restrictions, meaning that data access to third-parties is limited. For more information on these restrictions, including how to enable this app, visit https://docs.github.com/articles/restricting-access-to-your-organization-s-data/ (403)
Cause
This is most probably an org setting in Github, restricting third party apps also block Oauth apps.
Solution
The service user owning the private repositories needs to be added as an org admin to overcome this and the connection should work fine.