CSV からのデータのインポート

JIRA にバンドルされている JIRA インポーター プラグインを使用すれば、カンマ区切り形式(CSV)ファイルからデータをインポートできます。CSV ファイルは、表形式データを表すテキストファイルで、表形式データを処理する、ほとんどのアプリケーション(たとえば、Microsoft Excel、データベース等)でサポートされています。

CSV インポート機能により、次のような外部(課題トラッキング)システムから課題をインポートできます。

  • JIRAは専用のインポートツールを提供していません、そして
  • 構造化/表形式(できれば、CSV 形式)でデータをエクスポートできる外部システム。

(info) Our main website highlights some top reasons why people migrate from such an external issue tracking system to JIRA.

CSV インポート プロセスの手順

  1. CSV ファイルの準備 (後述)。
  2. CSV ファイル インポート ウィザードの実行 (後述)。
    • インポート プロセスで個々のフィールドやフィールド値のマッピングを選択できます。
    • At the end of the CSV file import wizard, you will be given the option of creating a CSV configuration file, which contains the settings you configured whilst running through the CSV file import wizard. This is useful if you need to test your CSV file import on a test JIRA server first before performing the import on a production system.

(warning) 注意:

  • Several methods are available for importing data from other issue tracking systems into JIRA. Depending on your other issue tracking system, it may be more appropriate to use one of these other methods than to first export your data from that system to a CSV file and then import that CSV file into JIRA. If your other issue tracking system is listed on the Migrating from Other Issue Trackers page, try using the appropriate method for that issue tracker (which is accessible from that page) to import data into JIRA.
  • この機能に関するバグレポートや改善提案を上げたい場合は、 JIRA インポーター プラグイン プロジェクト内で行ってください。

On this page:

CSV ファイルの準備

JIRA インポータープラグインは、CSV ファイルがデフォルトの Microsoft Excel 形式の CSV ファイルに基づいているものと想定します。フィールドはコンマで区切られ、文字どおりに扱われる必要のあるコンテンツ (コンマや改行/「キャリッジリターン」そのもの) は、引用符で囲まれます。

(info) Microsoft Excel と OpenOffice の場合、セル内の値を引用符で囲む必要はありません。これらのアプリケーションでは、自動でこの処理が行われます。

CSV ファイルの要件

CSV ファイルには、"適切に構造化されている" ことに加えて次の要件があります。

各 CSV ファイルには、要約列を持つ見出し行が存在する必要がある

CSV ファイル インポート ウィザード(下記)は、 CSV ファイルの見出し行を使用して、CSV ファイルの 2 行目以降のデータを JIRA のフィールドにマッピングする方法を決定します。

The header row should avoid containing any punctuation (apart from the commas separating each column) or the importer may not work correctly.

The header row must contain a column for 'Summary' data.

列/フィールドのセパレーターとしてのコンマは省略不可

たとえば、以下は有効です。

Summary, Assignee, Reporter, Issue Type, Description, Priority
"Test issue", admin, admin, 1, ,

しかし、以下は無効です。

Summary, Assignee, Reporter, Issue Type, Description, Priority
"Test issue", admin, admin, 1

CSV ファイルで JIRA データ構造をカプセル化する

複数行にまたがるデータを取得する

Use double-quote marks (") in your CSV file to capture data that spans multiple lines. For example, upon import, JIRA will treat the following as a valid CSV file with a single record:

Summary, Description, Status
"Login fails", "This is on
a new line", Open

特殊文字を文字どおりに扱う

Use double-quote marks (") around a section of text to treat any special characters in that section literally. Once this data is imported into JIRA, these special characters will be stored as part of JIRA's field data. Examples of special characters include carriage returns/enter characters (as shown in the example above), commas, etc.

二重引用符を文字どおりに扱うようにするには、もう 1 つ二重引用符を追加して "エスケープ" します。したがって、CSV 値は次のようになります。

  • "Clicking the ""Add"" button results in a page not found error"
    once imported, will be stored in JIRA as:
  • Clicking the "Add" button results in a page not found error

複数の値を単一の JIRA フィールドに集約する

You can import multiple values into a JIRA field that accepts multiple values (e.g. Fix (for) Version, Affects Version, Component, Labels). To do this, your CSV file must specify the same column name for each value you wish to aggregate into the mapped JIRA field. The number of column names specified must match the maximum number of values to be aggregated into the mapped field. For example:

IssueType, Summary, FixVersion, FixVersion, FixVersion, Component, Component
bug, "First issue", v1, , , Component1,
bug, "Second issue", v2, , , Component1, Component2
bug, "Third issue", v1, v2, v3, Component1,

In the above example, the Component field of the second issue and the Fix Version field of the third issue will generate multiple values in appropriate JIRA fields upon import.

(warning) 複数の値をサポートしている JIRA フィールドは限定されているので注意してください。CSV インポーターは、単一の値のみをサポートしている JIRA フィールドへの集約データのインポートを許可しません。

添付ファイルをインポートする

CSV ファイルから作成された課題にファイルを添付できます。これを行うには、CSV ファイル内の "Attachments" 列で、添付ファイルの URL を指定します。

Assignee, Summary, Description, Attachment, Comment
Admin, "Issue demonstrating the CSV attachment import", "Please check the attached image below.", "https://jira-server:8080/secure/attachment/image-name.png", "01/01/2012 10:10;Admin; This comment works"
Admin, "CSV attachment import with timestamp,author and filename", "Please check the attached image below.", "01/01/2012 13:10;Admin;image.png;file://image-name.png", "01/01/2012 10:10;Admin; This comment works"

(info) URLs for attachments support the HTTP and HTTPS protocols and can be any location that your JIRA server must be able to access. You can also use the FILE protocol to access files in the import/attachments subdirectory of your JIRA Home Directory.

サブタスクの作成

CSV ファイルで構造をカプセル化することにより、CSV ファイルのインポートを通して課題のサブタスクを作成できます。この操作を行うには、次の手順を実行します。

  • Your CSV file requires two additional columns whose headings should be named similarly to Issue Id and Parent Id.
  • Ensure each regular (non sub-task) issue is given a unique (sequential) number in the Issue Id column. Do not include any value in the Parent Id fields for regular issues.
  • To create a sub-task of a regular issue in your CSV file, reference the unique Issue Id number of the regular issue in the Parent Id column. Do not include any value in the Issue Id fields for sub-tasks.

例:

IssueType, Summary, FixVersion, FixVersion, FixVersion, Component, Component, Issue ID, Parent ID, Reporter
Bug, "First issue", v1, , , Component1, , 1, , jbloggs
Bug, "Second issue", v2, , , Component1, Component2, 2, , fferdinando
Bug, "Third issue", v1, v2, v3, Component1, , 3, , fferdinando
Sub-task, "Fourth issue", v1, v2, , Component2, , , 2, jbloggs

In the example above, the fourth issue will be sub-task of the second issue upon import, assuming you match the 'Issue ID' and 'Parent ID' fields in your CSV file to the Issue Id and Parent Id JIRA fields, respectively during the CSV file import wizard.

複数の JIRA プロジェクトに課題をインポートする

CSV ファイルのインポートを通じて、課題を CSV ファイルから様々な JIRA プロジェクトにインポートできます。この操作を行うには:

  • Your CSV file requires two additional columns whose headings should be named similarly to Project Name and Project Key.
  • Ensure that every issue represented in your CSV file contains the appropriate name and key in these columns for the JIRA projects to which they will be imported.
    (info) The project name and key data is the minimum JIRA project data required for importing issues from a CSV file into specific JIRA projects.
IssueType, Summary, Project Name, Project Key
bug, "First issue", Sample, SAMP
bug, "Second issue", Sample, SAMP
task, "Third issue", Example, EXAM

In the example above, the first and second issues will be imported into the 'Sample' project (with project key 'SAMP') and the third issue will be imported into the 'Example' project (with project key 'EXAM') , assuming you match the 'Project Name' and 'Project Key' fields in your CSV file to the Project name and Project key JIRA fields, respectively during the CSV file import wizard.

未解決の課題の処理方法

For fields mapping to Resolution, Priority and Issue Type, you will get a select list with the available values in JIRA. In addition, you can quickly create values that do not exist in JIRA by clicking the green plus symbols.

ステータスへのフィールド マッピングについては、JIRA で利用可能な値が入った選択リストが提供されますが、新しいステータス値を作成するプラス記号は用意されていません。

これらの 4 つのフィールドについては、JIRA で使用可能な値のほかに、次の 2 つの特別なオプションが選択リストに用意されています。

  • 「空白としてインポート」 - これによって、そのフィールドの JIRA の値は空白になります。未解決の課題をインポートする場合、解決状況フィールドをマッピングするフィールドを作成し、「未解決」の値を「空白としてインポート」に設定する必要があるので注意してください。
  • 「マッピングなし」 - これは CSV ファイルの値をそのままインポートしようとするものです。フィールド値に「マッピングなし」を使用する場合、値がその JIRA フィールドで有効でないと、インポートが失敗するので注意してください。ステータスと課題タイプへのフィールド マッピングについては、「空白としてインポート」オプションを選択した場合、既定値が使用されます。

作業ログ エントリのインポート

CSV ファイルには作業ログ エントリを含めることができます。例:

Summary,Worklog
Only time spent (one hour),3600
With a date and an author,2012-02-10 12:30:10;wseliga;120
With an additional comment,Testing took me 3 days;2012-02-10 12:30:10;wseliga;259200

消費時間を追跡するには、秒単位を使用する必要があります。

複数選択カスタムフィールドへのインポート

CSV ファイルには、1 つの複数選択カスタムフィールドへの複数のエントリを含めることができます。例:

Summary,Multi Select,Multi Select,Multi Select
Sample issue,Value 1,Value 2,Value 3

これは、複数の値を持つ複数選択カスタムフィールドにデータを追加します。

既存の課題の更新

JIRA インポーター プラグインのバージョン 4.3 から、既存の課題の更新が可能となりました。インポート ウィザードの実行時に、課題キーにマッピングされる列を CSV ファイルに含める必要があります。所定のキーに対応する課題が存在する場合、その課題は更新されます。例:

issue key,summary,votes,labels,labels
TT-1,Original summary,1,label1,label2
TT-1,,7,label-1,label-2
TT-1,Changed summary,,,
TT-2,Original summary 2,1,label-1,label-2
TT-2,,<<!clear!>>,<<!clear!>>,

最初の行では課題を作成し、2 行目では投票を 7 に設定して、2 つのラベルを追加します。次の行では要約が変更されます。課題 TT- 2 は 2 つのラベルとともに作成され、2 行目は特殊なマーカー、 <<!clear!>> によって、これらのラベルを削除します。

(warning) Importing a CSV to update existing issues will reset columns to their default values if they are not specified in the CSV.

CSV ファイル インポート ウィザードを実行する

Before you begin: If your JIRA installation has existing data — Back up your existing JIRA data.

  1. Jira 管理者グローバル権限を持つユーザーとしてログインします。
  2. Select Administration > System > Import & Export > External System Import > Import button associated with the Comma-separated values (CSV) option to open the CSV File import page.
    (tick) Keyboard shortcut: g + g + start typing external system import
  3. On the CSV File import page, select your CSV Source File. If you want to change the file's encoding and CSV delimiter format, click the Advanced heading to reveal this option (as shown in the above screenshot).
    (info)  Note:
    • ファイルは、ここで指定したファイルのエンコード方法 (既定では UTF- 8) を使用してインポートされます。
    • CSV ファイルでコンマ以外の別の区切り文字を使用する場合、[CSV 区切り記号] フィールドでその文字を指定します。
  4. Leave the Use an existing configuration file check box cleared if you do not have a configuration file or if you want to create a new configuration file. Configuration files specify a mapping between column names in your CSV file's header row and fields in your JIRA installation.
    (info)  Note:
    • このオプションを選択すると、既存の設定ファイルを指定するかどうか尋ねられます。
    • このオプションを選択しない場合、CSV ファイル インポート ウィザード の最終段階で、今後の CSV インポート(CSV ファイル インポート ウィザードの本ステップ)で使用できる設定ファイルが作成されます。
  5. [次へ] ボタンを クリックして、 CSV ファイル インポート ウィザードの [プロジェクト マッピングの設定] ステップに進みます。
  6. プロジェクト マッピングの設定ページで、すべての課題を 1 つの JIRA プロジェクト(新規または既存)にインポートするか、または(CSV ファイルに必要な最小限の JIRA プロジェクト データ - すなわち、JIRA プロジェクト名とキーが含まれるようにして )複数の JIRA プロジェクトにインポートするか、いずれかの設定が可能です。次のフィールド/オプションを入力します。

    JIRA プロジェクトへのインポート

    以下のいずれかを選択します。

    • プロジェクトを選択し、次のいずれかの操作を行います。
      • JIRA にすでに存在するプロジェクトの名前(またはキー)を入力するか、ドロップダウンメニューを使用して、既存の JIRA プロジェクトを選択します。
      • Select Create New from the dropdown menu and in the resulting Add A New Project dialog box, type the following:
        1. 新規プロジェクトの名前
        2. A new project Key
          (info) This will be used as the prefix for all issue IDs in your JIRA project.
        3. プロジェクト リーダー
    • Defined in CSV. Ensure that every issue in your CSV file includes data for the JIRA Project Name and Project Key.
      (tick) This option is useful if you want to import issues from your CSV file into multiple JIRA projects. See Importing issues into multiple JIRA projects for details.
    新規ユーザー用のメール識別子CSV ファイルで指定され、インポート中に JIRA に追加される新規ユーザー用のメールアドレス ドメインを入力します。
    インポートファイルの日付形式CSV ファイルで使用する日付形式を指定します。Java SimpleDateFormat に準拠した構文を使用します。
  7. Click the Next button to proceed to the Setup field mappings step of the CSV file import wizard.

  8. On the Setup field mappings page, specify each CSV Field (determined by your CSV file's header row) you want to import into your chosen JIRA project by selecting their check boxes under the Import column on the left.
    (info)  Please Note:

    • 少なくとも、これらのフィールドのいずれかに JIRA のサマリ フィールドのデータが含まれている必要があります。

    • If your CSV file contains more than one of the same field name specified in its header row, the CSV file import wizard will aggregate these into a single field, which will be marked by a (warning) symbol at this step of the wizard.

  9. In the JIRA field column, select the JIRA fields you want to match to fields defined in your CSV file (i.e. each CSV Field you selected in the previous step). For more information about matching CSV fields to JIRA fields, see Tips for importing CSV data into JIRA fields below.
    (info)  Please Note:

    • サマリ フィールドは、JIRA フィールドのいずれかを指定してマッピングする必要があります。これを行うまでは、次へ ボタンは使用不可のままとなります。

    • CSV ファイル インポート ウィザードによって集約された CSV フィールドに対しては、複数の値をサポートする JIRA フィールドしか選択できません。

    • サブタスクをインポートする場合、JIRA の課題 ID  フィールドと親ID  フィールドを CSV ファイルの対応するフィールドに一致させるのを忘れないようにします。
    • 複数のプロジェクトに課題をインポートする場合、上記のプロジェクトのマッピング設定ステップで CSV で定義済みを選択していることを確認し、JIRA のプロジェクト名フィールドとプロジェクト キー フィールドを CSV ファイルの対応するフィールドに一致させるのを忘れないようにします。
  10. To modify the values of any fields' data in the CSV file before they are imported into JIRA, select the Map field value check boxes next to the appropriate fields.
  11. [次へ] ボタンをクリックして、CSV ファイル インポート ウィザードの [値マッピングの設定] ステップに進みます。
  12. On the Setup value mappings page, specify the JIRA field values for each CSV file field value (which has been detected by the CSV file import wizard).
    (info) Please Note:
    • Any fields whose Map field value check boxes were selected in the previous step of the CSV file import wizard will be presented on this page.
    • 値を現状のままインポートしたい場合は、フィールドを空欄のままにしておくか、フィールド内のコンテンツを消去します。

    • You can create new Priority, Resolution and Issue Type values in JIRA (i.e. based on the data in your CSV file) by clicking the Add new ... link (e.g. Add new issue type 'subtask' shown in the screenshot above) next to the appropriate field.

    • If you are importing a username-based CSV field (e.g. Reporter or Assignee) and you do not select the Map field value check box for this field in the previous step of the CSV file import wizard, then the importer will automatically map imported usernames from the CSV file to (lowercase) JIRA usernames.
      (info) Regardless of whether or not you select the Map field value check box, JIRA will automatically create usernames based on the data in your CSV file if they have not already been defined in JIRA. 

  13. Click the Begin Import button when you are ready to begin importing your CSV data into JIRA. The importer will display updates as the import progresses, then a success message when the import is complete.
    (info) Note:
    • インポートで問題が生じた場合、[詳細ログのダウンロード] リンクをクリックして、CSV ファイルのインポート処理に関する詳細情報を表示します。
    • この手順を通じて使用した設定と同じ (または類似の) 設定で別の CSV ファイルをインポートする必要がある場合は、[設定を保存] リンクをクリックして、CSV 設定ファイルをダウンロードします。この設定ファイルは、CSV ファイルインポート ウィザードの最初のステップで使用できます。

お疲れ様でした。CSV データが Jira に正常にインポートされました!ご不明な点や、問題が生じた場合は、Aアトラシアン サポートにご連絡ください。

CSV データを JIRA フィールドにインポートするためのヒント

データを CSV ファイルから特定の JIRA フィールドにインポートする場合に役立つヒントを以下に示します。

JIRA フィールド

インポート時の注意

プロジェクト

CSV データはプロジェクト単位でインポートされます。対象として既存の JIRA プロジェクトを指定できますが、指定しなくても、インポート時にインポーターが自動的に新規プロジェクトを作成します。

要約

これは唯一の必須フィールドです。

課題キーインポートされた課題の課題キーを設定できます。所定のキーを備えた課題がすでに存在する場合、その課題は代わりに更新されます。

コンポーネント

単独の列に各コンポーネントを入力することで、複数のコンポーネントを持つ課題をインポートできます。

影響バージョン

単独の列に各バージョンを入力することで、複数の「影響バージョン」を持つ課題をインポートできます。

修正バージョン

個別の列に各バージョンを入力することで、複数の "修正バージョン" を持つ課題をインポートできます。

コメント本文

単独の列に各コメントを入力することで、複数のコメントを持つ課題をインポートできます。

作成日

CSV インポート ウィザードの 2 番目の手順で指定した日付形式を使用してください。

更新日

CSV インポート ウィザードの 2 番目の手順で指定した日付形式を使用してください。

期日

CSV インポート ウィザードの 2 番目の手順で指定した日付形式を使用してください。

課題タイプ

If not specified in your CSV file, imported issues will be given the default (i.e. first) Issue Type as specified in your JIRA system  Defining 'Issue Type' Field Values. You can also create new JIRA values on-the-fly during the import process.

ラベル

単独の列に各ラベルを入力することで、複数のラベルを持つ課題をインポートできます。

Priority

If not specified in your CSV file, imported issues will be given the default (i.e. first) Priority as specified in your JIRA system  Defining 'Priority' Field Values. You can also create new JIRA values on-the-fly during the import process.

ソリューション

If not specified in your CSV file, imported issues will be given the default (i.e. first) Resolution as specified in your JIRA system  Defining 'Resolution' Field Values. You can also create new JIRA values on-the-fly during the import process.

Also see How to handle unresolved issues for helpful tips.

ステータス

JIRA の既存のワークフロー ステータスにのみマッピングできます。CSV ファイルでステータスが指定されていない場合、インポートされた課題には、 JIRA システムで指定されているように、既定(すなわち、1 番目)のステータスが設定されます。

初期見積り

このフィールドの値は、秒数で指定する必要があります。

残余見積り

このフィールドの値は、秒数で指定する必要があります。

消費時間

このフィールドの値は、秒数で指定する必要があります。

ユーザー

担当者または報告者フィールドの値として、インポーターに JIRA ユーザーを自動で作成させることも可能です。

  • ユーザーは、JIRA のアクティブなアカウントとして作成されます。ユーザーは JIRA への初回のログイン時にパスワードをメールで通知してもらう必要があります。
  • 実名でないユーザーは、メールアドレス (ログイン名) の "@" 文字の前の部分を JIRA でのフルネームとして取得します。
  • 外部ユーザー管理 を使用している場合、インポート プロセスでは JIRA ユーザーを作成できません。代わりに、作成の必要がある新規ユーザーの一覧が、インポーターから提供されます。インポートを開始する前に、ユーザーは外部ユーザー リポジトリでユーザーを作成する必要があります。
  • ユーザー数に制限のあるライセンス (例: パーソナル ライセンス) で、必要なユーザー数が制限を超える場合、インポートは停止されます。作成できないユーザーの一覧を示すページが表示されます。
  • 担当者および報告者がマッピングされない場合、ユーザー名は作成されません。

その他のフィールド

If your wish to import any other fields, you can choose to map them to specific JIRA custom field(s). If your custom fields don't yet exist in JIRA, the importer can automatically create them for you. If your custom field is a date field, please use the date format specified on the second step of the CSV import wizard.

最終更新日: 2013 年 10 月 28 日

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

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