Having problems with your account or logging in?
A lot of changes are happening in the community right now. Some may affect you. READ MORE HERE
Highlighted
SkiiNox Frequent Contributor.
Frequent Contributor.
117 views

API REST Creating defect Missing required field

 

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-Jsonwrite-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.

0 Likes
2 Replies
Micro Focus Contributor
Micro Focus Contributor

Re: API REST Creating defect Missing required field

0 Likes
SkiiNox Frequent Contributor.
Frequent Contributor.

Re: API REST Creating defect Missing required field

Hello, yes i have the documentation and it's written i can use json.

Even if i try an update i've got a no field are specified. My json must be not well formated but there is nothing in the doc that can help me.

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.