Delays for commits to display in Development Panel in Jira server

お困りですか?

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

コミュニティに質問

プラットフォームについて: 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 は除く

問題

Commits from either Bitbucket or GitHub are slow to appear in Jira after they have been made. Often commits are not seen for up to 1 hour. 

診断

Users are not seeing commits in the development panel or Jira issues after they have been made in Bitbucket or Github. By default, Jira checks for updates every 60 minutes unless the commit is pushed by the Repository or a SmartCommit was used.

原因

When setting up the DVCS Connection, the OAuth Token provided did not come from an account with high enough permissions to be able to create Webhooks in the Repository Environment.  The connection can be established however the webhooks to POST Commits and Updates back to JIRA were not added.  

In the Jira Logs:

WARN ... /secure/admin/AddGithubOrganization!finish.jspa [plugins.dvcs.service.RepositoryServiceImpl] Adding postcommit hook for repository https://github.com/TEAM/repo failed. Probably insufficient permission

Viewing the Webhooks from within Bitbucket or GitHub show that there are no Webhooks configured to send POST messages back to the JIRA instance.

ソリューション

  • Recreate the OAuth Token with an account with sufficient permissions to create the Webhooks
  • Re-add the repositories or the organizations
    (info) The errors only show up in the logs by default when adding organizations. When adding repositories, the errors show up in the UI - to make them appear in the logs, add the com.atlassian.jira.plugins.dvcs package as INFO.

Workaround - Jira 8.14 or higher

If an elevated account cannot be used or is unavailable, the webhooks will need to be created manually for each repository:

Starting in Jira 8.14, the URL doesn't contain the repository ID, so if all repositories are being synchronized, you can set the Webhooks org-wide, even though that's not what the DVCS plugin does.
The steps below show how to create the Webhook for each repository.

Bitbucket

  1. Go to your Bitbucket repository settings.

  2. Go into "Services" underneath the Integrations heading at the left.

  3. Choose "POST" from the dropdown and hit Add Service.

  4. Put the following URL in:

     https://<Jira-Base-URL>/rest/bitbucket/1.0/webhook/bitbucket

GitHub

You will need to create 2 Webhooks

  1. Go to your GitHub repository settings.
  2. Go into "Webhooks & Services" > "Add Webhook"
  • WebHook #1
    1. Payload URL:

       https://<Jira-Base-URL>/rest/bitbucket/1.0/webhook/github
    2. Content type: application/json
    3. Which events would you like to trigger this webhook: Just the push event

    4. Check "Active"
    5. Add Webhook
  • WebHook #2
    1. Payload URL:

       https://<Jira-Base-URL>/rest/bitbucket/1.0/webhook/github
    2. Content type: application/json
    3. Which events would you like to trigger this webhook: Let me select individual events
      1. Check the Following:
        1. Pull request
        2. Pull Request review comment
    4. Check "Active"
    5. Add webhook


Workaround - Jira 8.13 or lower

If an elevated account cannot be used or is unavailable, the webhooks will need to be created manually for each repository:

Repository ID

To get a list of the repositories that the JIRA DVCS plugin is currently aware of and their associated IDs, you can use the API call below to return an XML listing of all repositories.

GET https://<Jira-Base-URL>/rest/bitbucket/1.0/repositories

Bitbucket

  1. Go to your Bitbucket repository settings.

  2. Go into "Services" underneath the Integrations heading at the left.

  3. Choose "POST" from the dropdown and hit Add Service.

  4. Put the following URL in:

     https://<Jira-Base-URL>/rest/bitbucket/1.0/repository/<repository id>/sync

GitHub

You will need to create 2 Webhooks

  1. Go to your GitHub repository settings.
  2. Go into "Webhooks & Services" > "Add Webhook"
  • WebHook #1
    1. Payload URL:

       https://<Jira-Base-URL>/rest/bitbucket/1.0/repository/<repository id>/sync
    2. Content type: application/x-www-form-urlencoded
    3. Which events would you like to trigger this webhook: Just the push event

    4. Check "Active"
    5. Add Webhook
  • WebHook #2
    1. Payload URL:

       https://<Jira-Base-URL>/rest/bitbucket/1.0/repository/<repository id>/sync
    2. Content type: application/json
    3. Which events would you like to trigger this webhook: Let me select individual events
      1. Check the Following:
        1. Pull request
        2. プッシュ
        3. Issue comment
        4. Pull Request review comment
    4. Check "Active"
    5. Add webhook

(info) Note: The endpoint for the DVCS connector is contains /bitbucket/ even for GitHub.

説明 Commits from either Bitbucket or GitHub are slow to appear in JIRA after they have been made.  Often commits are not seen for up to 1 hour. 
製品Jira
プラットフォームServer
最終更新日 2023 年 4 月 18 日

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

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