I'm trying to create a new defect with powershell.
I can connect to the api and even get the list of all defects or by id.
I'm now trying to create a defect but without success.
Indeed, i'm sending a json but i'm only getting a "missing required field: description for entity defect"
here is my powershell
$data = @{
description="dsfdsfsdffsdf"
"detected-by"="myuser"
"priority"="N/A"
owner="myuser"
"severity"="Minor"
status="Open"
name="test"
"user-04"="myproject"
"user-07"="Delivery"
"user-08"="Dummy1"
"user-09"="Acceptance"
"user-11"="01"
"user-22"="eaz"
"detected-in-rcyc"="1367"
}
$JSON = $data |ConvertTo-Json
write-host $JSON
$url = "http://****:8080/qcbin/rest/domains/mydomain/projects/myproject/defects/"
$result = Invoke-RestMethod -Method Post -Uri $url -WebSession $websession -Body $JSON -ContentType "application/json"
And the error :
Invoke-RestMethod :
Missing required field: description for entity defect
HPE Application Lifecycle Management
Missing required field: description for entity defect
Exception Id:
qccore.required-field-missing
Show Details
Exception Properties:
field-name: description
entity-name: defect
Stack Trace:
Thank you for your help.