如何在 HP ALM 中更新测试运行的环境值

问题描述

我正在使用 Java 中的 REST 保证进行 hp-alm 的 API 自动化。我正在尝试将 Environment 作为 SIT/UAT/DEV 更新到运行实例,但出现错误。 网址:https://alm.srv.westpac.com.au/qcbin/rest/domains/Test/projects/AVPL/test-instances/13061 状态码:500 正文:

<Entity Type='test-instance'>
 <Fields>
  <Field Name='status'><Value>Not Completed</Value></Field>
  <Field Name='environment'><Value>0</Value></Field>
  </Fields>
</Entity>


Error:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>

<head>
    <title>environment with id &#x27;1&#x27; does not exist</title>
    <link rel="stylesheet" type="text/css" href="/qcbin/rest-exception/rest-exception.css" />
    <script type="text/javascript" src="/qcbin/rest-exception/rest-exception.js"></script>
</head>

<body>
    <div id="banner">
        <img src="/qcbin/rest-exception/hp-logo.png" id="banner-logo"/>
        <h3 id="banner-title">HP Application Lifecycle Management</h3>
    </div>

    <div id="content-holder">
        <h1>environment with id &#x27;1&#x27; does not exist</h1>
        <div>
            <tr>
                <td><a id="exception-id-title">Exception Id:</a></td>
                <td>qccore.general-error</td>
            </tr>
        </div>
        <a id="more-details-label" style="display:none" href="#" onClick="javascript:toggleDetails()">
            <h3>Show Details</h3>
        </a>
        <div id="details-holder" style="display:none">
            <div style="display:none">
                <h4>Exception Properties:</h4>
                <div></div>
            </div>
            <div style="display:none">
                <h4>Stack Trace:</h4>
                <div></div>
            </div>
        </div>
    </div>
</body>

</html>

postman response

解决方法

能够使用不同的字段名称更新环境值