POST/projects/{ProjectId}/testsets/{Id}/items/{Seq}

Applies to QAComplete 14.3, last modified on February 19, 2024

Inserts a test set item to the specified position in a test set.

Use the operation to insert a test set item (test) at a specified position in a test set.

To replace a test set item at a specified position, use the …/testsets/{Id}/items/{Seq} (PUT) operation.

Authentication

Basic authentication using a user’s login and password. See Authentication for details.

Security Rights

The authenticating user must belong to a security group that has the Update privilege for Test Sets.

Request Format

To insert a test set item into a test set, send a POST request to the following URL:

http://{server}/rest-api/service/api/v1/projects/{ProjectId}/testsets/{Id}/items/{Seq}
URL parameters

Id  :  integer, required

The ID of the test set to which the item will be added

ProjectId  :  integer, required

The ID of the project to which the test set belongs.

Seq  :  integer, required

The position in the test set where the test set item will be added.

Body parameters

In the request body, pass the RequestTestSetItemBySeqPost object that describes the test set item to be inserted.

{
  "TestId": "int",
  "IsActive": "boolean",
  "IsStoppedOnFail": "boolean",
  "AssigneeUserId": "int",
  "DefaultHostId": "int"
}

TestId  :  string, required

The ID of the test in the Test Library to which the test set item corresponds

IsActive  :  boolean

Specifies whether the test set item is enabled (active).

IsStoppedOnFail  :  boolean

Specifies whether the test set run will stop when the item fails.

AssigneeUserId  :  integer

The ID of the user to whom the item is assigned. 0 if the item is not assigned to anyone.

DefaultHostId  :  integer

The ID of the host to which the item is assigned. 0 if the item is not assigned to any host.

A sample request:

POST http://yourserver.com/rest-api/service/api/v1/projects/11873/testsets/182/items/2 HTTP/1.1
Host: yourserver.com
Connection: keep-alive
Content-Type: application/json
Accept: application/json
Authorization: Basic am9obkBleGFtcGxlLmNvbTpwQHNzd29yZA==
Content-Length: 94

{
  "TestId": 2678,
  "IsActive": true,
  "IsStoppedOnFail": true,
  "AssigneeUserId": 24714
}

A sample request made by using cURL:

curl -u [email protected]:p@ssword -d @testitem.txt -H "Content-Type: application/json" -H "Accept: application/json" http://yourserver.com/rest-api/service/api/v1/projects/11873/testsets/182/items/2

Response Format

If successful, the operation responds with HTTP status code 200. The response is a JSON object with information on the added test set item.

A sample response:

HTTP/1.1 200 OK
Content-Type: application/json; charset=utf-8
Content-Length: 379


{
  "id": 1513,
  "project_id": 11873,
  "test_set_id": 182,
  "test_id": 2678,
  "seq": 2,
  "is_active": true,
  "is_stopped_on_fail": true,
  "assignee_user_id": 24714,
  "default_host_id": 0,
  "date_created": "2015-08-09T09:27:45.6700000",
  "date_updated": "2015-08-09T09:27:45.6700000",
  "create_user_id": 24714,
  "update_user_id": 24714,
  "title": "Test input data",
  "nbr_steps": 0,
  "nbr_files": 0,
  "nbr_notes": 0
}

Error responses

If the operation fails, it returns the appropriate status code and (optionally) the error description in the response body.

If the project with the specified ProjectId does not exist or the authenticating user does not have rights to access the project, the operation returns the Access is denied error.

See Also

Test Sets Resources

Highlight search results