How to create multiple sub-tasks based on a multi-select Assets custom field using Automation

お困りですか?

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

コミュニティに質問


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

シナリオ

For the purpose of this article, we'll consider the following scenario:

  • In an Onboarding request, it is necessary to create sub-tasks for each asset selected on the request form, so the IT team can properly setup the onboarding user's access, prepare their computer and accessories, etc.

To accomplish this, we'll leverage automations in a Service project.

Prerequisites

There's only two prerequisites for this scenario:

  1. Your Asset field must allow multiple objects to be stored within it
  2. Have sub-tasks setup on your Service project: Configuring sub-tasks

Preparing the Request Type

For simplicity's sake, in this scenario we'll be using a simple Request Type, that captures the Onboarding user's name in the Summary field. This is relevant when setting up the automation action that creates the sub-tasks:

The Automation

The automation we're building is actually quite simple, it can be defined by the following steps:

  1. WHEN a new Onboarding ticket is created;
  2. FOR EACH Asset, create a new sub-task.

To achieve that, we'll use the following Automation components:

  1. Trigger: We'll use the Issue Created trigger;
  2. Condition: We'll use a Issue fields condition on the Request Type field to make sure the automation will not misfire on unrelated requests;
  3. Advanced Branching: this component will define our FOR EACH "loop" that creates a separate sub-task for each asset informed on the "Onboarding Assets" field;
  4. Action: Create Issue - this action will be used to create the sub-tasks.

For our example, the Advanced Branch and Create Issue actions should look like so:

Smart values used:

  • {{issue.Onboarding Assets}} - This smart value is used on the Advanced Branching component, to fetch each individual object key of the objects added to our "Onboarding Assets" field. It can be used within the branch using the smart value {{asset}}, per the examples above.
  • {{issue.summary}} - In this example, this smart value will contain the summary of the original Onboarding request, therefore the employee's name.

Optional - Lookup objects action inside the branch

Optionally, we can add a Lookup Objects action within the branch in order to fetch additional information from the objects, as the branch smart value will provide us only the object's key as text, not the object itself:

With that, we can then use the object's name (or other information) to add to the Summary on the sub-tasks:

Smart values used:

  • {{lookupObjects.Name}} - This will contain the Name of the object being used to create the sub-task.

Final results

With the added Lookup Objects action in the example above, a new Onboarding ticket should successfully create sub-tasks in the following format: Asset Onboarding - Employee Name - Asset Name:

その他のリソース

Be sure to also check out our article on Assets smart values: Jira smart values - Assets



最終更新日 2023 年 8 月 23 日

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

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