The number of pull requests or branches from Bitbucket Server/DC differs between Jira Development Panel overview and details

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

Problem

Jira Development Panel shows a different number of pull requests or branches between the overview in the right panel and the detailed view after selecting either branch or pull requests link.

number of branches in pop up dialog is lower as number of branches on the ticket in the background

Diagnosis

  1. Verify via the REST API how many really open PR's in Bitbucket:

    1 2 curl -k -u username:password "https://bitbucket_base_url/rest/jira-dev/latest/detail/pullrequest?globalId=<JIRA_KEY>"
  2. Compare the results with the output from the Bitbucket integration cache:

    1 2 curl -k -u username:password "https://bitbucket_base_url/rest/remote-link-aggregation/latest/aggregation?globalId=<JIRA_KEY>"
  3. If the results are different then the issue is on the Bitbucket side so you can proceed with the next steps.

Cause

Rarely it is possible that indexing of pull requests or branches in a repository gets interrupted due to application link or connection error. This may result in incomplete or inaccurate data in the Jira Development Panel overview. This article shows how to restore missing pull request links between Bitbucket and Jira application.

Solution

Resolution

The reindex api below deletes the index and recreates it including only the Jira issue keys from:

  • the pull request title

  • the branch name

1 <bitbucket URL>/rest/jira-dev/1.0/projects/<project key>/repos/<repository slug>/reindex

For performance reasons, the Jira issue keys are not added back to the index if they are from:

  • the commit message

⚠️ This causes the Pull requests linked to Jira via an issue key in the commit message not to be displayed in the Development panel and in the details view.

This could be achieved in doing a full reindex.

From Bitbucket Data Center and Server 6.3.0 onwards, you can add an additional parameter withCommits=true to the API request URL to perform a full reindex.

  1. Trigger a full re-index for pull request and branches in Bitbucket to trigger webhooks and update the information in Jira:

    1 curl -v -u stash-admin -p -H "Accept: application/json" -H "Content-Type: application/json" -d "{}" <BITBUCKET_BASE_URL>/rest/jira-dev/1.0/projects/<PROJECT_KEY>/repos/<REPO_SLUG>/reindex?withCommits=true

    Wait some time and monitor if the date will be populated in the next step.

  2. Run the query below to check if the re-index populated both pull requests to Bitbucket's DB:

    1 SELECT * FROM "AO_777666_JIRA_INDEX" WHERE "ISSUE" = '<ISSUE_KEY>';
  3. Push at least one commit to the repository affected.

  4. Go back to Jira and confirm if the numbers are correct again.

⚠️ A full reindex may end up removing some links that currently exist. Jira periodically polls for updated issue keys and then fetching their new summary data. There's likely to be some delay between when reindexing finishes on Bitbucket Data Center and Server and when the updated development panel details show up in Jira. If you perform a full reindex, it can take minutes-to-hours (or maybe longer, depending on Jira version) for the updates to manifest.

Updated on April 10, 2025

Still need help?

The Atlassian Community is here for you.