Creating and linking an Asset object using Automation for Jira via REST API
プラットフォームについて: Data Center - この記事は、Data Center プラットフォームのアトラシアン製品に適用されます。
このナレッジベース記事は製品の Data Center バージョン用に作成されています。Data Center 固有ではない機能の Data Center ナレッジベースは、製品のサーバー バージョンでも動作する可能性はありますが、テストは行われていません。サーバー*製品のサポートは 2024 年 2 月 15 日に終了しました。サーバー製品を利用している場合は、アトラシアンのサーバー製品のサポート終了のお知らせページにて移行オプションをご確認ください。
*Fisheye および Crucible は除く
目的
- Currently, the integration between Automation for Jira and Assets objects is limited in the Jira Data Center, it's not possible to use Actions to create Assets objects:
要件
- Automation For Jira
- Assets plugin
- An Assets custom field configured for linking the object with the Jira issue - Default Assets custom field
ソリューション
This documentation described how to use Automation for Jira (bundled with Jira 9.0+) to create and link Assets objects in Jira issues using REST API from Assets: Assets REST API documentation
ステップ | |||||||
---|---|---|---|---|---|---|---|
1. | Create a trigger: In this example, "Field value changed" is used to monitor the "Labels" field for "All issue operations", but other triggers can be used depending on your needs: | ||||||
2. | Create an Issue fields condition: In order to trigger the automation, create an "Issue Fields Condition". For example, execute the automation for all Jira issues with the "assets_create_object" added: | ||||||
3. | Create a Send web request action: To create an object in Assets, we'll use the "Send Web Request" action to perform a POST in the create object REST API:
| ||||||
4. | Create an Edit issue action: Select the Assets custom field which will return the object created Additional fields: Add the JSON (webhook response smart value will be used to get the object key created)
Assets with Jira REST API Replace the Host custom field with your Assets custom field - | ||||||