Jenkins を Jira と統合する

Jenkins for Jira は、ファイアウォールの内側で実行されている Jenkins サーバーを Jira Cloud または Jira Service Management Cloud のいずれかと接続するための安全で信頼できる手段として無料で利用できるものです。

これによって、チームは Jira のすべての課題の詳細ビューで可視性とコンテキストを活用して、最新のビルド ステータスや、その作業が環境に正常にデプロイされたかどうかを確認できるようになります。

You can also use this information to search across issues using the Jira Query Language (JQL), answering questions like “Which issues in the current sprint have been deployed to production?” You can even add these as quick filters on your boards!

はじめる前に

Jenkins for Jira を接続して Jira プロジェクトにデータを流すには、次のタスクを実行または委任する必要があります。

  1. Jira で Jenkins for Jira アプリをインストールする

  2. Jira で Jenkins への接続を開始する

  3. Jenkins でアトラシアンの Jira Cloud プラグインをインストールする (必要な場合)

  4. Jenkins で、Jira に用意されている接続認証情報を入力して接続を完了する

  5. ソース コード管理プラットフォームか Jenkins で、プロジェクトの Jenkinsfiles を編集して Jenkins から Jira に送信されるデータを設定する

多くのチームでは、これらのタスクを適切な権限と経験を持つチーム メンバーに分けるのが理にかなっています。

Jenkins for Jira の接続プロセスを参考にして、これらのタスクを委任してください。ただし、始める前に、Jenkins 管理者が誰で、どのチーム メンバーが Jenkins パイプラインを定義する Jenkinsfiles の編集を担当しているかを知っておく必要があります。

これらのチーム メンバーが誰なのかわからない場合は、Jenkins を使用してコードをビルドおよびデプロイしている Jira プロジェクト チームに連絡してください。Jira プロジェクト チームが該当する担当者を教えてくれます。

Jira Cloud サイトに Jenkins for Jira をインストールする

必要な権限: Jira サイト管理者

Install the Jenkins for Jira (Official) app via Atlassian Marketplace:

  1. Log in to your Jira site and go to Apps > Explore more apps.

  2. Search for the Jenkins for Jira (Official) app and select Get app.

Jira で Jenkins への接続を開始する

必要な権限: Jira サイト管理者

After installing the Jenkins for Jira app on your Jira site, you’ll need to start a connection to Jenkins.

  1. In Jira, go to Apps > Manage your apps.

  2. In the left sidebar, under Apps, select Jenkins for Jira.

  3. If this is your first connection, you’ll be taken to the connection wizard. If you’ve previously connected a Jenkins server, select Connect another server to go to the wizard.

Follow the on-screen prompts in the connection wizard. This experience will vary depending on whether you are a Jenkins admin or a Jenkins admin is helping you, but in either case after giving your server a name, you’ll be provided with two credential items: a webhook URL and secret token to use in Jenkins.

接続プロセスを完了するには、あなたまたは Jenkins 管理者が Jenkins にログインし、サーバーをセットアップし、これらの認証情報を使用して接続を完了する必要があります。

Jenkins サーバーにアトラシアンの Jira Cloud プラグインをインストールする

必要な権限: Jenkins 管理者

Jira サイト管理者が Jira で接続を開始したら、Jira Cloud プラグインを Jenkins にインストールして接続を完了する必要があります。

  1. Log in to your Jenkins server and go to Manage Jenkins > Plugins > Available plugins.

  2. Search for Atlassian Jira Software Cloud and install the plugin.

If you can’t find the plugin in the Available plugins screen, it may already be installed on your server. To check:

  1. Log in to your Jenkins server and go to Manage Jenkins > Plugins > Installed plugins.

  2. Search for Atlassian Jira Software Cloud.

  3. プラグインがすでにインストールされている場合は、利用可能なアップデートを実行します。

Jenkins サーバーで接続を完了する

必要な権限: Jenkins 管理者

With the Atlassian Jira Software Cloud plugin installed on your Jenkins server, and a webhook URL and secret token at hand, you can now complete the connection between Jenkins and Jira.

  1. In Jenkins, go to Manage Jenkins > Atlassian Jira Software Cloud.

  2. Select Add new site.

  3. Enter your Jira site name

  4. Enter your Webhook URL

  5. Enter your Secret using the Jenkins credential manager.

    1. [追加] を選択します。

    2. From the Kind dropdown, select Secret text

    3. Paste the secret provided in the Jenkins for Jira connection wizard in the Secret field

    4. Give your secret a descriptive name (such as your site name) in the Description field

    5. [追加] を選択します。

    6. Use the Secret dropdown to select the secret you just entered.

  6. Select Test connection to make sure your credentials are valid for your Jira site.

  7. [保存] を選択します。

  8. If you’ve successfully entered your site name and credentials, you’ll be returned to Manage Jenkins > Atlassian Jira Software Cloud.

  9. (Optional) Set up build and deployment automations, if appropriate to your team.

  10. Select Save

この時点で Jenkins サーバーが Jira に接続されます。

Jenkins 管理者として接続プロセスを完了させるために Jira サイト管理者をサポートしている場合は、接続が完了したことを Jira サイト管理者に知らせます。Jenkins 権限を持つ Jira サイト管理者 (つまり、セットアップをすべて自分で完了する場合) の場合は、このタイミングで Jira に戻ります。

Jenkinsfile を編集して Jenkins サーバーから Jira サイトへのデータフローを設定する

必要な権限: Jenkins サーバーまたはソース コード管理プラットフォーム上の Jenkinsfile への書き込みアクセス権限

Once your Jenkins server is connected to Jira, Jira will generate a set up guide to help your team choose what data flows from the server to Jira. Your team must follow this guide to receive build and deployment events from Jenkins.

サーバーのセット アップ ガイドにアクセスする方法は以下のとおりです。

  1. In Jira, go to Apps > Manage your apps

  2. In the left sidebar, under Apps, select Jenkins for Jira.

  3. Navigate to the server you just selected and open the Set up guide tab. This guide will detail what your team needs to do to set up the flow of data between Jenkins and Jira.

  4. In most cases, the information in a set up guide is best used by developers in your project teams. Use Share this guide with your team to send them the guide in a read-only version of the Jenkins management page.

  5. Once your team has set up what build events your Jenkins server should send to Jira, you’ll start seeing those events populate the Recent events tab in your server.


Jenkins for Jira の仕組み

Jenkins for Jira と Jenkins サーバー向け Atlassian Jira Software Cloud プラグインが連携する仕組みに関する詳細な説明は、「Jenkins for Jira の仕組み」をご参照ください。このトピックは、Jenkins 管理者がビルド イベントやデプロイ イベントの自動送信などの詳細オプションをセットアップする際に役立つでしょう。

さらにヘルプが必要ですか?

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