Uploaded image for project: 'Jira Software Data Center'
  1. Jira Software Data Center
  2. JSWSERVER-25959

Not Enabling "Automatically Sync All Repositories" When Adding Git Provider Results in Unmatched Commits and Branches

      Issue Summary

      When the "Automatically sync all repositories" option is not enabled during the addition of a Git provider account (e.g., GitLab group, GitHub organization), existing commits and branches that are retrieved during the linking process are not matched to Jira issues as expected after the repository is manually added and a soft sync is performed.

      This is reproducible on Data Center: (yes)

      Steps to Reproduce

      1. Navigate to Jira and go to the DVCS accounts section.
      2. Add a new GitLab group, GitHub organization, etc.
      3. During the linking process, ensure that the "Automatically sync all repositories" option is not enabled.
      4. Complete the linking process.
      5. Manually add a repository and perform a soft sync.
      6. Verify that the existing commits and branches are not matched to Jira issues.

      Expected Results

      Existing commits and branches should be matched to Jira issues after the repository is manually linked and an initial sync is performed.

      Actual Results

      Existing commits and branches are not matched to Jira issues when the "Automatically sync all repositories" option is not enabled during the addition of the Git provider account and an initial sync is performed.

      Workaround

      Clear stale entries from the `AO_575BF5_DEV_SUMMARY` table for the specific affected issue keys. After clearing these records, the Git data will appear as expected.

      Steps to Clear Stale Entries:

      1. Access the Jira Database:

      • Connect to your Jira database using a suitable database management tool.

      2. Locate Stale Entries in `AO_575BF5_DEV_SUMMARY`:

      • Run the following SQL query to find entries related to the affected issue keys:
             SELECT * FROM "AO_575BF5_DEV_SUMMARY" WHERE "JSON" LIKE '%<ISSUE_KEY>%';
        

        Replace `<ISSUE_KEY>` with the actual issue key to find the specific records.

      3. Delete the Stale Entries:

      • Once the stale entries are identified, delete them using the following SQL command:
             DELETE FROM "AO_575BF5_DEV_SUMMARY" WHERE "ISSUE_ID" = (SELECT "ID" FROM "jiraissue" WHERE "issuenum" = <ISSUE_NUMBER> AND "project" = (SELECT "ID" FROM "project" WHERE "pkey" = '<PROJECT_KEY>'));
        

      Replace `<ISSUE_NUMBER>` with the issue number and `<PROJECT_KEY>` with the project key of the affected issue.

      5. Re-Sync the Repositories:

      • After clearing the stale entries, re-sync the repositories manually to ensure that the data is updated correctly.

      Reproduced Versions:

      Jira Version GitLab Version GitHub Version Reproduced
      9.15.2 17.0 Cloud ✓
      9.4.21 17.0 Cloud ✓
      7.13.0 Unsupported Cloud ✗

          Form Name

            [JSWSERVER-25959] Not Enabling "Automatically Sync All Repositories" When Adding Git Provider Results in Unmatched Commits and Branches

            There are no comments yet on this issue.

              Unassigned Unassigned
              ddiblasio David Di Blasio
              Affected customers:
              0 This affects my team
              Watchers:
              4 Start watching this issue

                Created:
                Updated: