Search code examples
javaapirest-assuredalmhp-alm

How to update Environment value for Test Run in HP ALM


I am doing an API automation of hp-alm using REST assured in Java. I'm trying to update Environment as SIT/UAT/DEV to the run instance but getting error. URL: https://alm.srv.westpac.com.au/qcbin/rest/domains/Test/projects/AVPL/test-instances/13061 Status Code : 500 Body:

<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


Solution

  • Able to update the environment value using different field name