How to Automate Asset Import Scheduling in JSM Cloud
Platform Notice: Cloud Only - This article only applies to Atlassian products on the cloud platform.
Summary
Discover how to use Automation rules to schedule Assets imports as a workaround for current limitations.
Solution
Things to keep in mind
Use an automation rule to schedule imports. First, execute the import to generate the import configuration ID needed for the rule.
Use the New feature: Import and refresh Insight data from a URL to minimize manual work. After setting up the rule, data from the URL is automatically imported into JSM Assets.
This process does not work for Discovery & External Imports. These Import Types are initiated & processed externally, by software that interacts with the Assets Import REST API. This process will work for JSON & CSV Imports, as these files are either uploaded already to Assets, or the provided URL is accessed by Assets itself.
Automation rule to schedule imports
This rule only requires two automation components, a trigger and an action.
Go to Project settings > Automation > Create rule.
Select trigger as Scheduled and set the schedule as per your requirement. You can also utilize cron expressions to set a schedule.
Add a Send web request action to send the Start import REST API:
Web request URL:
https://api.atlassian.com/jsm/assets/workspace/<YOUR WORKSPACE ID>/v1/import/start/<IMPORT CONFIGURATION ID>
To find your ID: Discover your workspaceId.
To find the import configuration ID, go to import history and find the configuration ID for the corresponding import configuration:
Headers:
Authorization:
Basic
followed by the base64 of youremailaddress:APItoken
. So if the base64 of theemailaddress:APItoken
is AB12XY45, add the valueBasic AB12XY45
. Steps on how to generate the API Token can be found here.Accept:
application/json
.
HTTP Method: POST
Web request body: Empty.
Publish the rule.
For more examples of how you can use Automation with Assets, check out Update Assets object attribute values using automation.
Was this helpful?