Automation rule to copy users associated with a project role into a multi user picker field

お困りですか?

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

コミュニティに質問

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

    

要約


This KB outlines the steps to configure an automation rule to copy users associated with a project role into a multi user picker field.

環境

Jira Cloud

ソリューション

Pre-requisite:

  • Create a custom field of type User Picker (multiple users) and add it to the screens associated with the required issue types. Make a note of the custom field ID to use it in the Advanced field editing.
  • Get the ID of the required project role using the Get all project roles.
  • Lets consider 10002 is the id assigned to the Administrators project role and the requirement is to update the user picker custom field with the associated users.

Automation Rule Configuration: 

Trigger: Choose the trigger as per your requirement.  

Condition: Add a condition to check issue types if required

Actions:

Action 1: Create Variable: If it's a Global rule, create a variable to capture the project ID for later use. 

Action 2: Send web request: Update the fields as below

  • Web request URL: https://<sitename>.atlassian.net/rest/api/3/project/{{projectid}}/role/10002
  • HTTP method: GET
  • Web request body: Empty
  • Ensure to select "Delay execution of subsequent rule actions until we've received a response for this web request"
  • Headers (optional)

Action 3: Edit Issue

Choose More Options to edit the issue through Advanced field editing. Add the below JSON:

{
    "fields": {
        "customfield_xxxxx": [
           {{#webResponse.body.actors.actorUser}}
           {
                "accountId": "{{accountId}}"
            }
        {{^last}},{{/last}}
        {{/webResponse.body.actors.actorUser}}
       ]
    }
}

Note: customfield_xxxxx is the id of the multi user picker custom field.


最終更新日: 2025 年 1 月 3 日

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

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