Jira Data Center development panel information is out of sync with Bitbucket Data Center

Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. 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

There is a discrepancy between the data shown in Jira's development tool information and what's really in Bitbucket. For old branches/issues, this data will never get refreshed.

This out-of-sync situation can be observed:

a) The Development Panel Summary in the Jira issues shows it is "Open," while Bitbucket shows it is "Merged."

Bitbucket shows pull request "Merged" and Jira shows it "Open"

b) At the Release Data page, when selecting a release and expanding the list of issues with the Release status per issue.

Statuses don't match between Release Data page and expanded issues.

Diagnosis

  • Even if the application links are healthy and Jira is syncing with Bitbucket for further updates (Pull Requests, commits, etc.), ones that got stale due to some error situation or timeouts, will have to be forced synced.

  • The information provided in the Development Panel Summary, when editing an issue or when listing the issues from one release, is gathered from the AO_575BF5_DEV_SUMMARY table. The JSON_VALUE column contains the status information data (which holds status) for that particular issue:

1 SELECT * FROM "AO_575BF5_DEV_SUMMARY" WHERE "JSON" LIKE '%<issue-key>%';
  • Here is the breakdown of data when queried to the AO_575BF5_DEV_SUMMARY table. There could be multiple rows in the table for this issue key, but it is important to decide which object types we are after (for example commit, pull requests, branches, etc.):

    1 2 3 4 5 6 7 8 9 10 11 12 13 14 2021-05-03 04:25:32.986 | 9989027 | 6411084 | {"value":{"targets":{"XYZ-1943":[{"type": {"id":"repository"} ,"objects":[ {"lastUpdated":"2021-05-04T17:11:28.000+0000","count":4,"commits":["f770e5059233f0313ce6158f921cd2b507e8acc3","ee2d26c7406f3ac03c2f96d55fcdc5b039efa9b9","420a69758ca30a1a40291f0801b5fea52522bc11","17b37a42f4cfc31a7504d45f40c9745781f775d3"],"type":"git"} ]},{"type": {"id":"branch"} ,"objects":[ {"lastUpdated":"2021-05-04T17:11:45.162+0000","count":1,"branches":["bugfix/XYZ-1943_Things_are_not_working"]} ]},{"type": {"id":"pullrequest"} ,"objects":[ {"lastUpdated":"2021-05-04T17:11:45.162+0000","state":"OPEN"} ]}]}},"expiry":9223371721494775807} | xxxxxxxxxx-a875-39ec-98a0-xxxxxxxxx | 2021-05-04 17:11:45.693
  1.  In the JSON above, there are three objects: repository, branch, and pull request.

  2. Pick the object we need correction on, here pull request.

  3. Make sure that long id xxxxxxxxxx-a875-39ec-98a0-xxxxxxxxx in the pull request, the object type corresponds to the ID of the app link where the Pull Request is coming from. You can do that by clicking on the edit link for that app link in the UI and the browser nav bar will show that ID(quickest). You can of course check DB for it too :)

  4. Notice state is OPEN, which is not the same as Bitbucket's actual Pull Request state.

  5. Expiry attribute, that is how Bitbucket determines which objects to re-sync/sync.

Cause

The information provided by Jira at the Development Panel Summary and at the Release Data is collected from the Jira AO_575BF5_DEV_SUMMARY table. The detailed information, gathered when we click at the Pull Request, Commit, or Branch links is gathered from Bitbucket, using the REST API.

One of the possible causes for this issue is the Bitbucket issue BSERV-9452 - There is no way to update out-of-date info in Jira Server/DC's dev summary panel for old branches. The link aggregation result is returning cached data, and the other REST call is returning data from the pull request table. The latter will always be correct since it's the real data, but since those branches aren't in use now the cached data will never get updated again.

Solution

Option #1: Expiry date on Jira, forcing to get an update from Bitbucket

We can force sync the state of stale object types from Bitbucket by updating the expiry property of pull request in that particular row of AO_575BF5_DEV_SUMMARY table.

  1. Copy the JSON content returned by the query to a text editor: 

    1 SELECT * FROM "AO_575BF5_DEV_SUMMARY" WHERE "JSON" LIKE '%<issue-key>%';
  2. Using any Unix Timestamp converter, calculate a date in the past, for instance, 08/25/2021 4:48 pm UTC corresponds to the Unix Timestamp 1619894065;

  3. On the text editor, replace the expiry information (on our sample, the previous value was "expiry":9223371721494775807) with the Expiry date in the past ("expiry":1619894065);

  4. Run the Update query below using the new JSON value prepared on the text editor and commit the changes:  

    1 2 3 4 5 update "AO_575BF5_DEV_SUMMARY" set "JSON" = '{"value":{"targets":{"XYZ-1943":[{"type":{"id":"repository"},"objects":[{"lastUpdated":"2021-05-04T17:11:28.000+0000","count":4,"commits":["f770e5059233f0313ce6158f921cd2b507e8acc3","ee2d26c7406f3ac03c2f96d55fcdc5b039efa9b9","420a69758ca30a1a40291f0801b5fea52522bc11","17b37a42f4cfc31a7504d45f40c9745781f775d3"],"type":"git"}]},{"type":{"id":"branch"},"objects":[{"lastUpdated":"2021-05-04T17:11:45.162+0000","count":1,"branches":["bugfix/XYZ-1943_Things_are_not_working"]}]},{"type":{"id":"pullrequest"},"objects":[{"lastUpdated":"2021-05-04T17:11:45.162+0000","state":"OPEN"}]}]}},"expiry":1619894065}' where "ISSUE_ID" = 6411084 and "PROVIDER_SOURCE_ID" = 'xxxxxxxxxx-a875-39ec-98a0-xxxxxxxxx'; commit;
  5. Wait for the refresh to happen in the issue or reload the issue.

Option #2: Reindex Bitbucket and force a new event to send an update to Jira

  1. Use the following endpoint to run a reindex on Bitbucket using a user with Bitbucket admin access:

    • Curl Command using User authentication: 

      1 curl -v -u <username> -p -H "Accept: application/json" -k -H "Content-Type: application/json" -d "{}" <bitbucket URL>/rest/jira-dev/1.0/projects/<project key>/repos/<repository slug>/reindex
    • Sample for the project SUP_CM and the repository playground

      1 curl -v -u <username> -p -H "Accept: application/json" -k -H "Content-Type: application/json" -d "{}" <bitbucket URL>/rest/jira-dev/1.0/projects/SUP_CM/repos/playground/reindex
      • The request should return HTTP Response 204.

      • If the authentication is not accepted, use Personal access tokens for authentication:

      curl -v -p -H 'Authorization: Bearer MDM0MjM5NDc2MDxxxxxxxxxxxxxxxxxxxxx' -H "Accept: application/json" -H "Content-Type: application/json" -d "{}" <bitbucket URL>/rest/jira-dev/1.0/projects/SUP_CM/repos/playground/reindex

  2. Create a new Pull Request and merge it, to force a new update on Jira.

  3. Wait for the refresh to happen in the issue or reload the issue.

Updated on March 3, 2025

Still need help?

The Atlassian Community is here for you.