HP QC ALM REST API :(缺少必填字段)创建新的缺陷POWERSHELL

时间:2019-03-14 13:43:05

标签: rest powershell alm qc

我正在尝试使用powershell创建一个新缺陷。

我可以连接到api,甚至可以获取所有缺陷列表或按ID。

我现在正在尝试制造缺陷,但是没有成功。

确实,我正在发送json,但是我只收到“缺少必填字段:实体缺陷的描述”

这是我的动力壳

$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"

错误:

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:

谢谢您的帮助。

0 个答案:

没有答案