I am having an issue where I want to replace the text below in the body, 'Test to Output', with a parameter 'BuildVersion'. The API POST works when hardcoded but I want it to write back the exe for the AUT which is captured at runtime, and added to currentBuild.description, but just can't figure out the syntax. Can anyone point me in the right direction please? It is a Jenkins script with PowerShell used for the POST request.
def BuildVersion = currentBuild.description
echo BuildVersion
powershell '''
$headers = New-Object "System.Collections.Generic.Dictionary[[String],[String]]"
$headers.Add("Content-Type", "application/json")
$headers.Add("Authorization", "token")
$body = "{`n `"value`": `"Test to Output`"`n}"
$response = Invoke-RestMethod 'https://api.clickup.com/api/v2/task/task_id/field/field_id' -Method 'POST' -Headers $headers -Body $body
$response | ConvertTo-Json
'''
}