Get-FLCItemAssociations

Returns a collection of attachments or affected items which are associated to the given Fusion Lifecycle Item.

Syntax

Get-FLCItemAssociations -Workspace <string> -ItemId <long> -AffectedItems [<CommonParameters>]
Get-FLCItemAssociations -Workspace <string> -ItemId <long> -Attachments [<CommonParameters>]
Get-FLCItemAssociations -InputObject <psobject> -AffectedItems [<CommonParameters>]
Get-FLCItemAssociations -InputObject <psobject> -Attachments [<CommonParameters>]

Parameters

Type

Name

Description

Optional

String

Workspace

The name of the workspace that contains the item whose associated Items are retrieved

no (optional when InputObject is used)

Long

ItemId

The ID of the item whose associated Items are retrieved

no (optional when InputObject is used)

Item

InputObject

The Fusion Lifecycle Item whose associated Items are retrieved. The argument accepts pipeline input

no (optional when Workspace and ItemId are used)

SwitchParameter

AffectedItems

Retrieves associated Affected Items (can be Linked Items and/or Managed Items).

no (optional when Attachments is used)

SwitchParameter

Attachments

Retrieves associated Attachments.

no (optional when Attachments is used)

Return type

LinkedItem[] / Attachment[] ← On success.
empty ← on failure. Exception/ErrorMessage can be accessed using $Error.

Remarks

The SwitchParameters AffectedItems and Attachments cannot be combined.

AffectedItems

The passed -Workspace has to be configured properly and must allow viewing the according Affected Items in the Linked Items Tab.
This tab is often known as Managed Items- or Affected Items Tab (or even “Workflow Items”, “Associated Change Orders”, …) within revisioning workspaces.

For such revisioning Items the cmdlet returns the exact revisions of all the Affected Items from the associated revision-controlled workspaces.

The resulting Items can be located in different Workspaces.

Attachments

The passed -Workspace has to be configured properly and must allow viewing the according Attachments in the Attachments Tab.

The Cmdlet returns a list of all the direct Attachments for the passed Fusion Lifecycle Item.

Examples

To use the examples below a Fusion Lifecycle PLM demo Tenant is required:

Display all the Affected Items for a revisioning Item in Fusion Lifecycle

Connect-FLC -Tenant 'your_tenant_name' -ClientId 'your_client_id' -ClientSecret 'your_client_secret' -UserId '[email protected]'
$item = (Get-FLCItems -Workspace 'Change Orders' -Filter 'ITEM_DETAILS:NUMBER="CO000012"')[0]
$affectedItems = $item | Get-FLCItemAssociations -AffectedItems

#Print details which are displayed in the 'Managed Items' tab in Fusion Lifecycle
$global:index=0
$affectedItems | Format-Table -Property @{name="index";expression={$global:index;$global:index++}},Number,LinkedItem_Lifecycle,LinkedItem_EffectivityDate,LinkedItem_FromRevision,LinkedItem_ToRevision,LinkedItem_Disposition

<#
index Number    LinkedItem_Lifecycle      LinkedItem_EffectivityDate  LinkedItem_FromRevision  LinkedItem_ToRevision  LinkedItem_Disposition
----- --------- ------------------------- --------------------------- ------------------------ ---------------------- -----------------------
1     001-00001 Bypass Design and Release 18.02.2016 00:00:00                                  A                      Rework
1     001-00001 Bypass Design and Release 18.02.2016 00:00:00                                  A                      Scrap
2     035-00001 Bypass Design and Release 18.02.2016 00:00:00                                  A
...
45    035-00002 Design Revision           06.11.2021 00:00:00        2                        3                      Use Until Depleted
#>

Display all the Attachments for an Item in Fusion Lifecycle

Connect-FLC -Tenant 'your_tenant_name' -ClientId 'your_client_id' -ClientSecret 'your_client_secret' -UserId '[email protected]'
$attachments = Get-FLCItemAssociations -Workspace 'Change Request' -ItemId 7584 -Attachments

#Print details which are displayed in the 'Attachments' tab in Fusion Lifecycle
$attachments | Format-Table -Property 'FileName',Title,Version,@{name="Type";expression={"$([System.IO.Path]::GetExtension($_.'File Name').TrimStart('.').ToUpper()) Image"}},@{name="Size";expression={"$([Math]::Round($_.Size/1KB,1)) KB"}},Description

<#
FileName                    Title                   Version Type   Size      Description
--------------------------- ----------------------- ------- ------ --------- -----------
GT220 Change Proposal.png   GT220 Change Proposal         1  Image 1313.4 KB Screenshot
p681 Heatsink Cap Issue.jpg p681 Heatsink Cap Issue       1  Image 146.5 KB
#>

Error handling, analyze why retrieving Linked Items or Attachments failed using $Error

Connect-FLC -Tenant 'your_tenant_name' -ClientId 'your_client_id' -ClientSecret 'your_client_secret' -UserId '[email protected]'
$linkedItems = Get-FLCItemAssociations -Workspace 'Suppliers' -ItemId 6394 -AffectedItems

if(-not $linkedItems){
   $Error[0].Exception #Returns "FORBIDDEN: User ****: access VIEW_WORKFLOW_ITEMS denied..."
}