How to copy values between multiple choice fields via automation.

お困りですか?

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

コミュニティに質問

プラットフォームについて: Cloud のみ - この記事は、 クラウド プラットフォームのアトラシアン製品にのみ適用されます。

要約

One would want to create a new issue in another project with select fields. However, there's a problem with using automation to copy multiple choice field values from a Jira Service Management project to Jira Work Management project.

Source JSM project

Recipient JWM project

 

The problem is the smart value get converted to a single item rather than a list, e.g. products (a, b) is converted to a single item "a,b" (rather than "a" and "b" ) and it doesn't match any options. This will leave the receiving multiple choice field as blank. 

環境

Jira Service Management Cloud | Jira Work Management Cloud | Jira Discovery (Beta). 

ソリューション

Go to your Project Settings > Automation and start a new rule with the following components:

New trigger: Select the trigger that meets your design requirements.  

Create variable action. Give the variable a name and set smart value of the multiple choice field. 

{{#issue.customfield_id}}{"value": "{{name}}"},{{/}}

Since multiple choice fields often times have more than one value. Use of # symbol will iterate through those values and store them as a variable.

(info)When using #, you must close the expression with {{/}}.

Helpful Links:

Create Issue, select your JWM project and Issue type, Select Copy From for Summary field.


Select Choose fields to set drop down, select field.  More options, using JSON to set values on target project field.


{
    "fields": {
       "customfield_10486": [{{ProductVar.match("(.*)(?=,)")}]
       
    }
}

The use of regex is needed to parse through the values as a list and stores them in the JWM project multiple choice field properly. 

This is a workaround for bug AUTO-93.

最終更新日 2022 年 9 月 28 日

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

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