Jira Data Center の自動化ルールを使用して 2 つのカスタム フィールド間で値をコピーする方法
プラットフォームについて: Data Center のみ。 - This article only applies to Atlassian apps on the Data Center プラットフォーム。
この KB は Data Center バージョンの製品用に作成されています。Data Center 固有ではない機能の Data Center KB は、製品のサーバー バージョンでも動作する可能性はありますが、テストは行われていません。 Server* 製品のサポートは 2024 年 2 月 15 日に終了しました。Server 製品を実行している場合は、 アトラシアン Server サポート終了 のお知らせにアクセスして、移行オプションを確認してください。
*Fisheye および Crucible は除く
要約
1 つのテキスト フィールド (フィールド A) の内容を別のテキスト フィールド (フィールド B) にコピーする場合、Jira 自動化ルールを使用してこれを実行できます。数値フィールドやユーザー ピッカー フィールドなど、他のほとんどのフィールド タイプでも同じ方法を使用できます。
環境
Jira Data Center 8.0.0 以降のバージョン
Automation for Jira 7.4.0 以降のバージョン
ソリューション
Pick the right method for your situation
Same field type, no transformation needed → Use the "Edit issue" action → "Copy from" dropdown. This is the simplest and recommended approach.
Same field type, with concatenation or formatting → Use the "Edit issue" action with a smart value such as
{{triggerIssue.fieldName}}.Different field types (e.g. text → user picker) → Add a Lookup Issues step first to resolve the value; document the type mismatch in the rule description.
Cascading fields, custom date formats, or list field types → Refer to the Jira automation smart values reference for the correct syntax for your field type before configuring.
自動化で「コピー元」アクションを使用する
目的のプロジェクトまたは Jira のグローバル自動化ページに移動します
新しい自動化ルールを作成します。
ルールに [課題を編集] アクションを追加します。
設定する必要があるフィールド (この例では「フィールド B」) を選択します。
Select ...(More options) > Copy from...
値のコピー元となる課題:「現在の課題」
値のコピー元のフィールド: ソース フィールド (この例では「フィールド A」) を選択します。
フィールドを直接利用できない場合はスマート値を使用する
[元のストーリー ポイント] フィールドなど、一部のフィールドは自動化で直接サポートされていないため、ルール エディターの [コピー元] ダイアログに表示されません。
これらのフィールドからデータをコピーすることはできますが、そのためにはスマート値を活用します。[元のストーリー ポイント] を [ストーリー ポイント] フィールドにコピーするルールを作成しましょう。
目的のプロジェクトまたは Jira のグローバル自動化ページに移動します
新しい自動化ルールを作成します。
自動化ルールに [課題を編集] アクションを追加する
設定する必要があるフィールドを選択します (例: 「ストーリー ポイント」)
次の文字列をコピーしてフィールドに貼り付けます。
|
スマート値の [元のストーリー ポイント ] フィールドを、自動化エディターで直接利用できない他のフィールドに変更することもできます。
自動化ルールで JSON オブジェクトを使用する
JSON 式を使用して [追加フィールド] セクションでフィールドのコピーを実行する場合は、次の手順に従います。
[課題を編集] アクションを追加します
どのフィールドも選択せず、
Instead, expand the More Options setting
次の JSON 式を [ 追加フィールド ] セクションにコピーします。
「Target Field」の部分を選択したターゲット フィールドの名前に、「Source Field」の部分を選択したソース フィールドの名前にそれぞれ書き換えてください。
|
Note: Inserting JSON objects will only work with basic field types such as the Text and Number types. If you are looking into using a JSON formula to copy array-type fields such as Multi-User picker or Multi-Option fields, you will need to use a different syntax.
これらのタイプのフィールドに適用される解決策は、以下の記事で説明されています。
Why didn't the value copy? Common causes
If the rule runs without errors but the destination field remains empty, check the following:
Field type mismatch — Copying a text value into a number field (or vice versa) will silently fail with no error. Ensure both fields are the same type, or use a lookup/transformation step to convert the value first.
Field not on any screen — Automation cannot set a field that isn't on any screen for the affected issue type. Verify the destination field is on the relevant Create/Edit/View screen in Project Settings → Screens.
Workflow validator or required field blocking the edit — A workflow validator or a required field on the edit screen can silently block the Edit Issue action. Check Project Settings → Workflows for validators on the current transition.
Rule actor missing "Edit Issues" permission — The user or app account running the rule must have the Edit Issues project permission. Go to Project Settings → Permissions and verify the rule actor is included. See Run Jira automation rules as another user for rule actor configuration.
Source field empty at trigger time — If using "Copy from", verify the source field has a value when the trigger fires. Fields set by post-functions or populated asynchronously may be empty at trigger time. Consider adding a condition to check the source field is not empty before the Edit Issue action.
関連記事
Jira automation triggers — full list of available triggers for automation rules
Jira smart values — issues — reference for all available smart values, including field-type-specific syntax
Run Jira automation rules as another user — configure the rule actor and its permissions
Edit issue fields with Jira automation — full reference for the Edit Issue action
Get started with Jira automation — automation overview and setup
この内容はお役に立ちましたか?