DVCS Sync is not adding private repositories
Platform Notice: Cloud, Server, and Data Center - This article applies equally to all 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
When adding a new DVCS account, the list of expected repositories prepared does not contain all the expected repositories.
Cause
The Oauth used for the connection with GitHub was created using a user that is not an owner of the repository on the GitHub.
Solution
Find which is the Authorization account used for the connection:
- On Jira, go to Jira Admin > Applications > DVCS Accounts and click the menu options at the right on the organization row.
- On the menu presented, click on "Reset OAuth Settings". You will see a screen similar to the screen below, where you will be able to see the GitHub account used for the authorization, for instance, "GHuser1" (do not edit, just cancel after seeing the Authorizing account);
2. Contact the GitHub Admin owner of the organization, for instance, "GHBoss" to choose one of the options:
2.1. Add the GitHub member "GHuser1" as an owner also
on GitHub, Select the Organization > People > Select the engine icon for "GHuser"> Option "Change role" > Select Owner
2.2 OR GitHub admin "GHBoss" should create an OAuth to be used by Jira, instead of "GHuser1"
- on Jira, go to Jira Admin > Applications > DVCS Accounts > Delete;
Deleting an account removes it permanently from Jira, including all of its repositories and synchronized changesets; - Wait until none of the repositories on GitHub has more WebHooks for Jira on it. This might take days depending on the size of your organization;
- Select the biggest repository from this organization > Click Settings > Webhook to check if they were already removed;
- Sign in on Github using "GHBoss" account;
- on GitHub, Select the Organization > Settings > Developer setting > OAuth Apps > get the client ID and create a new secret;
- On Jira, Add again the organization, this time using "GHBoss" client ID and the secret created;
- Jira will connect with GitHub using the Oauth just created and GitHub might ask for authorization;
- Once connected, Jira sync will start. It will first create a list of repositories, then it will start adding sequentially each repository, adding the webhooks on GitHub side also.