I try to make an object like this:
$bodyObject = [pscustomobject]@{
'fields' = [pscustomobject]@{
'fixVersions' = @([pscustomobject]@{
'id' = $releaseId
})
}
};
$bodyJson = $bodyObject | ConvertTo-Json;
Write-Output $bodyJson;
I got the following output:
{
"fields": {
"fixVersions": [
"@{id=16919}"
]
}
}
How can I achieve valid JSON structure like this?
{
"fields": {
"fixVersions": [
{"id": "16919"}
]
}
}