Using Powershell.
Problem:
Data coming from JSON API request & Stored in Variable "$Ticket".
When i export it to CSV using Export-CSV, data not populating in Column format instead coming in Row format for Custom_field & Values.
Code Result Coming in Row Format:
=====================================
URL Custom_field Values
https://<url>.com/api/31325.json 45504409, 360000890277, GSL,False,False
,27190369, 38670589,
Expected Result Should be in Columns for (Custom_Field & Values ) to be Exported as CSV.
========================================================================================
URL Custom_field Values
https://<url>/api/v2/tickets/31325.json 45504409 GSL
https://<url>/api/v2/tickets/24422.json 360000890277 False
What I have tried:
<===========Code Start===========>
$outputfiles = 'C:\outputfile2.csv'
$tickets | Select-Object URL, @{Name="custom_fields";Expression={$_.custom_fields.id -join ", "}}, @{Name="Values";Expression={$_.custom_fields.value -join ", "}}` | Export-Csv -Path $outputfiles -NoTypeInformation
<=============Code End=============>