Open topic with navigation

# Version Control (Get/Update version control status)

Available in versions: 12.56 and later

## Description

Returns or updates the version control status of a test. The status defines if a test is checked-in or checked-out.

## URL

    /LoadTest/rest/domains/{domainName}/projects/{projectName}/tests/{id}/versioncontrol

## Remarks

The data can be passed as XML containing the equivalent data.

## HTTP Method

GET: Returns the version control state of a test.

PATCH: Updates the version control state of a test.

## Request

Headers:

Accept: application/xml

PATCH:

Content-Type: application/xml

Cookies:

- Version 2020 (or later): LWSSO_COOKIE_KEY={LwssoCookie};

- Versions earlier than 2020: LWSSO_COOKIE_KEY={LwssoCookie};QCSession={QCSessionCookie};

Request Body:

GET: No request body.

PATCH: An XML describing the new version control status in the test. Possible status values are `CheckedIn` and `CheckedOut`.

Request Example - GET

    GET /LoadTest/rest/domains/TEST_DOMAIN/projects/TEST_PROJECT/tests/8/versioncontrol HTTP/1.1
    Host: PCServer
    Cookie: LWSSO_COOKIE_KEY={LwssoCookie};

Request Example - PATCH

    PATCH /LoadTest/rest/domains/TEST_DOMAIN/projects/TEST_PROJECT/tests/8/versioncontrol HTTP/1.1
    Host: PCServer
    Cookie: LWSSO_COOKIE_KEY={LwssoCookie};
    Content-Type: application/xml

    <VersionControl xmlns="http://www.hp.com/PC/REST/API">
        <Status>CheckedOut</Status>
        <Comments>Reason for checking out</Comments>
    </VersionControl>

## Response

Headers:

GET. One of:

- Content-Type: application/xml
- Content-Type: application/json

PATCH: None

Cookies:

None

HTML Return Code:

One of the HTTP Return Codes.

Upon successful deletion, returns HTTP status 200 (OK).

HTML Body:

GET: Returns the data on the entity in the response.

PATCH: No body returned.

Response Example - GET

    <VersionControl>
      <Comments>Reason for checking out</Comments>
      <Status>CheckedOut</Status>
      <VersionNumber>6</VersionNumber>
      <UserName>sa</UserName>
      <VersionStamp>36</VersionStamp>
    </VersionControl>