--- title: "Get-RelativityProductions" slug: "scripting-get-relativityproductions" updated: 2024-09-23T13:06:26Z published: 2024-09-23T13:06:26Z canonical: "help.agilityblue.com/scripting-get-relativityproductions" --- > ## Documentation Index > Fetch the complete documentation index at: https://help.agilityblue.com/llms.txt > Use this file to discover all available pages before exploring further. # Get-RelativityProductions > [!NOTE] > Relativity Integration Required > > This cmdlet requires a valid Relativity integration in order to work. See the [Relativity integration](/v1/docs/relativity-integration) documentation to learn how to set up the integration. ## Summary Gets an array of Relativity productions from a Relativity workspace using a connected Relativity integration. ```powershell Get-RelativityWorkspaces    -IntegrationId    -WorkspaceArtifactId    -Raw ``` Returns an array of Relativity production objects. > [!NOTE] > Model > > This cmdlet returns the following fields from Relativity for this object: > > - ArtifactId (int) > - Name (string) > - DateProduced (DateTime) > - FirstBatesValue (string) > - LastBatesValue (string) > - SystemCreatedBy (string) > - SystemCreatedOn (DateTime) > - Status (string) > > **The cmdlet cannot be customized to return any other fields.** > [!WARNING] > Modern APIs Only > > This cmdlet will only work with integrations that have the “Use Modern Relativity Apis” switch applied for their configuration. ## Parameters | Parameter | Type | Required? | Notes | | --- | --- | --- | --- | | IntegrationId | Int32 | Yes | The integration id. | | WorkspaceArtifactId | Int32 | Yes | The artifact id of a Relativity workspace to retrieve productions from. | | Raw | Switch | No, defaults to `false` | If set to `true`, the cmdlet will provide the raw response from Relativity rather than an array of production objects. The content will be encoded as a Base64 string. Setting this switch is only useful if you are trying to troubleshoot a response that Relativity provided. | ## Examples ### Get a list of Relativity productions from a Relativity workspace ```powershell # Get a specific integration based on the Relativity identifier (url) # $relativityUrl = "https://my-company.relativity.one" $integrations = Get-Integrations `    -Filter "Name eq 'Relativity' and startswith(Identifier,'$relativityUrl')" $relativityIntegration = $integrations.Collection | Select-Object -First 1 if ($null -eq $relativityIntegration) {    Write-Error "Unable to find a Relativity integration with the identifier `"$relativityIdentifier`""    exit } # This call will cause Agility Blue to reach out to Relativity and ask for the productions # located in the workspace with artifact id 9012556. The result is an array of Relativity # productions. $relativityWorkspaceProductions = Get-RelativityProductions `    -IntegrationId $linkedRelativityWorkspace.IntegrationId `    -WorkspaceArtifactId 9012556 $relativityWorkspaceProductions | ConvertTo-Json ``` Output of this script: ```plaintext [  {    "ArtifactID": 7737926,    "Name": "ABC001",    "DateProduced": "2024-06-22T00:00:00",    "FirstBatesValue": "ABC0000001",    "LastBatesValue": "ABC0000318",    "SystemCreatedBy": "Blue, Johnny",    "SystemCreatedOn": "2024-06-22T19:27:27.607",    "Status": "Produced"  },  {    "ArtifactID": 9096137,    "Name": "ABC002",    "DateProduced": "2024-08-01T00:00:00",    "FirstBatesValue": "ABC0000319",    "LastBatesValue": "ABC0000369",    "SystemCreatedBy": "Blue, Katie",    "SystemCreatedOn": "2024-06-22T16:53:30.03",    "Status": "Produced"  } ] ```