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

お困りですか?

アトラシアン コミュニティをご利用ください。

コミュニティに質問

プラットフォームについて: Server および Data Center のみ。この記事は、Server および Data Center プラットフォームのアトラシアン製品にのみ適用されます。

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.

*Fisheye および Crucible は除く

問題

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.

診断

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

    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:

    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.

原因

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.

ソリューション

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

  • the pull request title
  • the branch name
<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:

    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:

    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.

(warning) 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.


説明 Jira Development Panel pull requests, and branch numbers differ.
製品Bitbucket

最終更新日 2021 年 8 月 6 日

この内容はお役に立ちましたか?

はい
いいえ
この記事についてのフィードバックを送信する
Powered by Confluence and Scroll Viewport.