This PowerShell script automates the migration of Flexible Assets from IT Glue into CloudRadial. It reads a CSV mapping file that pairs IT Glue Organization IDs to CloudRadial Company IDs, pulls all Flexible Asset Type definitions and their data from IT Glue, then recreates everything in CloudRadial via the IT Glue-compatible V2 API.
Like all V2 API features, Flexible Assets requires development experience to implement. This script handles the API calls for you, but you will need PowerShell 5.1+ and valid API keys for both IT Glue and CloudRadial.
In this article:
- Prerequisites
- Finding Your IDs
- Setting Up the Mapping CSV
- Setting Your Credentials
- Running the Script
- Filtering to Specific Asset Types
- What Happens in CloudRadial After Sync
- Controlling Visibility
- Troubleshooting
- How It Works
- Related Resources
Prerequisites
- PowerShell 5.1 or later
- An IT Glue API key - generate one at IT Glue > Account > Settings > API Keys
- CloudRadial API keys (Public + Private) - generate at Partner > Settings > Integrations > API > +Add API Key
- An organization mapping CSV file pairing IT Glue Org IDs to CloudRadial Company IDs (template included in the GitHub repo)
Finding Your IDs
IT Glue Organization IDs: Navigate to any organization in IT Glue - the numeric ID is in the URL. For example, in https://yourcompany.itglue.com/12345/... the ID is 12345.
CloudRadial Company IDs: Call the CloudRadial API to list companies:
$publicKey = "YOUR_PUBLIC_KEY"
$privateKey = "YOUR_PRIVATE_KEY"
$authHeader = @{
Authorization = "Basic " + [Convert]::ToBase64String(
[Text.Encoding]::ASCII.GetBytes("$($publicKey):$($privateKey)")
)
}
$companies = Invoke-RestMethod -Uri "https://api.us.cloudradial.com/v2/odata/company" `
-Headers $authHeader -Method Get
$companies.value | Select-Object id, name | Format-TableSetting Up the Mapping CSV
Create a file called org-mapping.csv with your IT Glue-to-CloudRadial organization pairings:
ITGlueOrgId,CloudRadialCompanyId,OrgName
12345,1001,Contoso Ltd
12346,1002,Fabrikam Inc
12347,1003,Northwind TradersThe OrgName column is optional - it is used for logging readability only.
Setting Your Credentials
Option A: Environment variables (recommended for automation)
$env:ITGLUE_API_KEY = "ITG.xxxxxxxxxxxxxxxxxxxx"
$env:CLOUDRADIAL_API_PUBLIC_KEY = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
$env:CLOUDRADIAL_API_PRIVATE_KEY = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"Option B: Pass as parameters directly when running the script (see the Running the Script section below).
Running the Script
Always do a dry run first with -WhatIf to preview changes before making them:
.\Sync-ITGlueFlexibleAssets.ps1 -MappingFilePath ".\org-mapping.csv" -WhatIfOnce you are satisfied with the dry run output, run the actual sync:
.\Sync-ITGlueFlexibleAssets.ps1 -MappingFilePath ".\org-mapping.csv"You can also pass credentials directly as parameters:
.\Sync-ITGlueFlexibleAssets.ps1 `
-ITGlueApiKey "ITG.xxxxxxxxxxxxxxxxxxxx" `
-CRPublicKey "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" `
-CRPrivateKey "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx" `
-MappingFilePath ".\org-mapping.csv"Filtering to Specific Asset Types
To sync only certain Flexible Asset Types instead of everything, use the -FlexibleAssetTypeFilter parameter:
.\Sync-ITGlueFlexibleAssets.ps1 `
-MappingFilePath ".\org-mapping.csv" `
-FlexibleAssetTypeFilter "Network Devices","Backup Systems"For Partners using IT Glue's EU or AU data centers, specify the base URL:
.\Sync-ITGlueFlexibleAssets.ps1 `
-MappingFilePath ".\org-mapping.csv" `
-ITGlueBaseUrl "https://api.eu.itglue.com"What Happens in CloudRadial After Sync
Once the script completes successfully:
- New menu items appear under the Infrastructure tab in the client portal
- Assets display in a grid format based on your field schema
- Clicking an asset shows the full detail view with all field data
- Clients can search and filter their assets
- You can rename the display names from Partner > Settings > Account & Branding > Sidebar
Controlling Visibility
Feature Sets: Enable or disable Flexible Assets per feature set to control which clients see them. Navigate to Partner > Feature Sets and edit the relevant set.
Security Roles: A new "Flexible Assets" permission section appears once Flexible Assets are in use. You can configure the standard Read, Write, Delete, and Full permissions at the role level. For more details on security roles, review the CloudRadial security roles documentation.
Troubleshooting
| Issue | Cause | Fix |
|---|---|---|
| API returned 401 (IT Glue) | Invalid or expired API key | Regenerate your IT Glue API key |
| API returned 401 (CloudRadial) | Invalid Public/Private key pair | Check keys at Partner > Settings > Integrations > API |
| Asset type name already exists | Type was already created in CloudRadial | The script skips duplicate types. Delete the existing type first if you want to re-create it |
| 429 Too Many Requests (IT Glue) | Rate limit exceeded (3000 requests per 5 min) | Reduce -PageSize or wait and re-run |
| Assets don't appear in portal | Feature set doesn't have Flexible Assets enabled | Enable at Partner > Feature Sets |
| Tag fields show raw IDs | IT Glue tag references don't carry over | Tag fields display text values; cross-references to other IT Glue assets will not be linked |
How It Works
The script uses two APIs in sequence:
IT Glue API (api.itglue.com):
-
GET /flexible_asset_types- pulls all type schemas with field definitions -
GET /flexible_assets?filter[organization-id]=X&filter[flexible-asset-type-id]=Y- pulls asset records per org and type
CloudRadial V2 Compatibility API (api.us.cloudradial.com):
-
POST /compatibility/flexible_asset_types- creates a type with all its fields -
POST /compatibility/organizations/{orgId}/relationships/flexible_assets- bulk inserts asset records
The compatibility API uses the same JSON:API-style structure as IT Glue, so trait keys and field kinds transfer directly with minimal transformation.
Related Resources
- Script and README on GitHub
- CloudRadial API Documentation
- IT Glue API Documentation
- Displaying IT Glue Flexible Assets in CloudRadial UCP (existing article)
- CloudRadial API Platform Webinar (Video)
If you are still having trouble, we're here to help! Submit a ticket here for assistance, and don't forget to check our status page to ensure there are no outages in your area.
Comments
0 comments
Please sign in to leave a comment.