How to bulk clone Assets objects to a different object type or schema using Automation

お困りですか?

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

コミュニティに質問


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

要約

Currently, in the Jira Service Management Assets tool, it is not possible to move objects to a different object type, and the Clone action can only create objects in the same object type as the original. With the help of Automation, we can create a process to bulk clone objects to a different object type or a different object schema, which can save you some time when moving objects is a necessity so you won't have to manually recreate all objects.

Some things to keep in mind when using this workaround:

Creating the setup

Before we can create and execute the automation rule, we need to make sure that the target object type has all of the attributes that the original object type has. For example, in the image below you can see that OldObject has the Warranty and User attributes (aside from the default ones):

So in the NewObject I'll also add the same attributes:

Creating the Automation Rule

Now that the object type setup is complete, we can create the automation rule to clone/move the objects from OldObject to NewObject.

Go to System (Cog Icon) > Global Automation (on the panel to the left) and start a new rule with the following components:

Scheduled Trigger: We use the scheduled trigger so we can execute the rule as needed. The schedule itself is not really important, but be aware that depending on how you configure it the rule might be triggered again. Ideally you should disable the rule after using it, and enable it again in case you need to use it in the future.


Branch on AQL: Select the schema where the objects reside and use the "Query" field to add an AQL that will narrow down the results. In this example, I only want to clone/move the OldObject object type assets, so I'll filter by adding "objecttype = OldObject". Feel free to add as many AQL statements as needed for your use case. For more information on how to build AQL statements, please check the Use Assets Query Language (AQL) article. 


Create Object: Select the target object schema and also the target object type where the objects will be created. After that, also select all attributes that will be copied over to the new objects and use the {{object.AttributeName}} smart value but replace <AttributeName> with the actual name of the attributes from the old objects.

After saving all of the changes, don't forget to name your automation rule and publish it by clicking on Turn it on:

After that, simply run the rule by clicking on the Run Rule button at the top right corner:


The objects should be copied over to the new object type and schema:


Currently, due to the following limitation, it's not possible to update more than 50 objects in a single Assets automation run:

For this reason, you might need to run the rule multiple times depending on the number of objects you need to clone.



最終更新日 2024 年 4 月 2 日

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

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