Test Plan Items
This chapter focuses on services for test plan items. An test plan item represents a test case that has been planned in an iteration test plan or a sprint requirement version’s test plan. It belongs to an iteration or sprint requirement version, and binds together the test case to execute with a dataset (optional) and an assigned user (optional).
Get test plan item
A GET to /test-plan-items/{id} returns the test plan item with the given id.
Path parameters
| Parameter | Description |
|---|---|
|
the id of the test plan item |
HTTP request
GET /api/rest/latest/test-plan-items/4 HTTP/1.1
Accept: application/json
Host: localhost:8080
Query parameters
| Parameter | Description |
|---|---|
|
which fields of the elements should be returned (optional) |
HTTP response
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 1805
{
"_type" : "test-plan-item",
"id" : 6,
"execution_status" : "SUCCESS",
"referenced_test_case" : {
"_type" : "test-case",
"id" : 3,
"name" : "Test Case 3",
"reference" : "TC3",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/test-cases/3"
}
}
},
"referenced_dataset" : {
"_type" : "dataset",
"id" : 2,
"name" : "Dataset 2",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/datasets/2"
}
}
},
"last_executed_by" : "User 6",
"last_executed_on" : "2017-02-04T11:00:00.000+00:00",
"assigned_to" : "User 6",
"executions" : [ {
"_type" : "execution",
"id" : 10,
"execution_status" : "SUCCESS",
"last_executed_by" : "User 6",
"last_executed_on" : "2017-02-04T11:00:00.000+00:00",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/executions/10"
}
}
} ],
"iteration" : {
"_type" : "iteration",
"id" : 1,
"name" : "Iteration 1",
"reference" : "IT1",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/iterations/1"
}
}
},
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/test-plan-items/6"
},
"project" : {
"href" : "http://localhost:8080/api/rest/latest/projects/1"
},
"test-case" : {
"href" : "http://localhost:8080/api/rest/latest/test-cases/3"
},
"dataset" : {
"href" : "http://localhost:8080/api/rest/latest/datasets/2"
},
"iteration" : {
"href" : "http://localhost:8080/api/rest/latest/iterations/1"
},
"executions" : {
"href" : "http://localhost:8080/api/rest/latest/test-plan-items/6/executions"
}
}
}
Response fields
| Path | Type | Description |
|---|---|---|
|
|
the type of this entity |
|
|
the id of this test plan item |
|
|
the execution status of this item |
|
|
the corresponding test case of this item |
|
|
the referenced dataset of this item |
|
|
the login of the user who last executed this item |
|
|
the date this item was last executed |
|
|
the login of the user this item is assigned to |
|
|
all the executions of this item |
|
|
the iteration this item belongs to (if the test plan item belongs to a sprint requirement version, this attribute will not appear) |
|
|
related links |
Links
| Relation | Description |
|---|---|
|
link to this test plan item |
|
link to the project this item belongs to |
|
link to the test case corresponding to this item |
|
link to the dataset used in this item |
|
link to the iteration this item belongs to (if applicable) |
|
link to the executions of this item |
Get test plan item (deprecated)
A GET to /iteration-test-plan-items/{id} returns the test plan item with the given id.
This endpoint is still functional but is deprecated. Please use the newer /test-plan-items/{id} endpoint above instead.
Create iteration test plan item
A POST to /iterations/{iterationId}/test-plan creates a new entry in the test plan of the iteration with the given id. The entry must
reference a test case, and optionally for which dataset and which assignee. If specified, the dataset must belong to the referenced Test Case.
The dataset and/or assignee may be undefined or null if you don’t want to set them yet.
Path parameters
| Parameter | Description |
|---|---|
|
the id of the iteration |
HTTP request
POST /api/rest/latest/iterations/4/test-plan HTTP/1.1
Content-Type: application/json
Accept: application/json
Content-Length: 183
Host: localhost:8080
{
"_type" : "test-plan-item",
"test_case" : {
"_type" : "test-case",
"id" : 25
},
"dataset" : {
"_type" : "dataset",
"id" : 3
},
"assigned_to" : "User-1"
}
Request fields
| Path | Type | Description |
|---|---|---|
|
|
the type of the entity |
|
|
the test case to include in the test plan (as described below) |
|
|
the type of the entity (always 'test-case') |
|
|
the id of the test case |
|
|
the dataset to be used when the test case will be executed (optional) |
|
|
the type of the entity (always 'dataset') |
|
|
the id of the dataset. Remember that the dataset must belong to the planned test case. |
|
|
the username of the user assigned to this test case (optional) |
HTTP response
HTTP/1.1 201 Created
Content-Type: application/json
Content-Length: 1515
{
"_type" : "test-plan-item",
"id" : 38,
"execution_status" : "READY",
"referenced_test_case" : {
"_type" : "test-case",
"id" : 25,
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/test-cases/25"
}
}
},
"referenced_dataset" : {
"_type" : "dataset",
"id" : 3,
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/datasets/3"
}
}
},
"last_executed_by" : null,
"last_executed_on" : null,
"created_by" : "admin",
"created_on" : "2017-07-12T10:00:00.000+00:00",
"last_modified_by" : "admin",
"last_modified_on" : "2017-07-12T10:00:00.000+00:00",
"assigned_to" : "User-1",
"executions" : [ ],
"iteration" : {
"_type" : "iteration",
"id" : 4,
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/iterations/4"
}
}
},
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/test-plan-items/38"
},
"project" : {
"href" : "http://localhost:8080/api/rest/latest/projects/14"
},
"test-case" : {
"href" : "http://localhost:8080/api/rest/latest/test-cases/25"
},
"dataset" : {
"href" : "http://localhost:8080/api/rest/latest/datasets/3"
},
"iteration" : {
"href" : "http://localhost:8080/api/rest/latest/iterations/4"
},
"executions" : {
"href" : "http://localhost:8080/api/rest/latest/test-plan-items/38/executions"
}
}
}
Create sprint requirement version test plan item
A POST to /sprint-req-versions/{id}/test-plan creates a new entry in the test plan of the sprint requirement version with the given id. The entry must
reference a test case, and optionally for which dataset and which assignee. If specified, the dataset must belong to the referenced Test Case.
The dataset and/or assignee may be undefined or null if you don’t want to set them yet.
For the test plan item to be created, the sprint requirement version’s parent sprint must not be closed.
Path parameters
| Parameter | Description |
|---|---|
|
the id of the sprint requirement version |
HTTP request
POST /api/rest/latest/sprint-req-versions/4/test-plan HTTP/1.1
Content-Type: application/json
Accept: application/json
Content-Length: 128
Host: localhost:8080
{
"test_case" : {
"_type" : "test-case",
"id" : 25
},
"dataset" : {
"id" : 3
},
"assigned_to" : "User-1"
}
Request fields
| Path | Type | Description |
|---|---|---|
|
|
the test case to include in the test plan (as described below) |
|
|
the type of the entity (always 'test-case') |
|
|
the id of the test case |
|
|
the dataset to be used when the test case will be executed (optional) |
|
|
the id of the dataset. Remember that the dataset must belong to the planned test case. |
|
|
the username of the user assigned to this test case (optional) |
HTTP response
HTTP/1.1 201 Created
Content-Type: application/json
Content-Length: 1238
{
"_type" : "test-plan-item",
"id" : 38,
"execution_status" : "READY",
"referenced_test_case" : {
"_type" : "test-case",
"id" : 25,
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/test-cases/25"
}
}
},
"referenced_dataset" : {
"_type" : "dataset",
"id" : 3,
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/datasets/3"
}
}
},
"last_executed_by" : null,
"last_executed_on" : null,
"created_by" : "admin",
"created_on" : "2017-07-12T10:00:00.000+00:00",
"last_modified_by" : "admin",
"last_modified_on" : "2017-07-12T10:00:00.000+00:00",
"assigned_to" : "User-1",
"executions" : [ ],
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/test-plan-items/38"
},
"project" : {
"href" : "http://localhost:8080/api/rest/latest/projects/14"
},
"test-case" : {
"href" : "http://localhost:8080/api/rest/latest/test-cases/25"
},
"dataset" : {
"href" : "http://localhost:8080/api/rest/latest/datasets/3"
},
"executions" : {
"href" : "http://localhost:8080/api/rest/latest/test-plan-items/38/executions"
}
}
}
Modify test plan item
A PATCH to /test-plan-items/{id} modifies the test plan item with the given id. You can modify the planned dataset, the assignee, or both. A property left absent from the json payload will not be altered, if present with a null value they will be reset. You cannot change the planned test case.
Path parameters
| Parameter | Description |
|---|---|
|
the id of the test plan item |
HTTP request
PATCH /api/rest/latest/test-plan-items/50 HTTP/1.1
Content-Type: application/json
Accept: application/json
Content-Length: 119
Host: localhost:8080
{
"_type" : "test-plan-item",
"dataset" : {
"_type" : "dataset",
"id" : 3
},
"assigned_to" : "User-1"
}
Request fields
| Path | Type | Description |
|---|---|---|
|
|
the type of the entity |
|
|
the dataset to use when the test case is executed (optional). You can remove the dataset by setting this to null. |
|
|
the type of the entity ('dataset') |
|
|
the id of this dataset |
|
|
the username of the user assigned to this test (optional). You can assign this test to nobody by setting this to null. |
HTTP response
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 1479
{
"_type" : "test-plan-item",
"id" : 50,
"execution_status" : "READY",
"referenced_test_case" : {
"_type" : "test-case",
"id" : 25,
"name" : "AKM-Test case 1",
"reference" : "",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/test-cases/25"
}
}
},
"referenced_dataset" : {
"_type" : "dataset",
"id" : 3,
"name" : "Jeu2",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/datasets/3"
}
}
},
"last_executed_by" : null,
"last_executed_on" : null,
"assigned_to" : "User-1",
"executions" : [ ],
"iteration" : {
"_type" : "iteration",
"id" : 4,
"name" : "Iteration 1",
"reference" : "IT1",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/iterations/4"
}
}
},
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/test-plan-items/50"
},
"project" : {
"href" : "http://localhost:8080/api/rest/latest/projects/14"
},
"test-case" : {
"href" : "http://localhost:8080/api/rest/latest/test-cases/25"
},
"dataset" : {
"href" : "http://localhost:8080/api/rest/latest/datasets/3"
},
"iteration" : {
"href" : "http://localhost:8080/api/rest/latest/iterations/4"
},
"executions" : {
"href" : "http://localhost:8080/api/rest/latest/test-plan-items/50/executions"
}
}
}
Modify test plan item (deprecated)
A PATCH to /iteration-test-plan-items/{id} modifies the test plan item with the given id. You can modify the planned dataset, the assignee, or both. A property left absent from the json payload will not be altered, if present with a null value they will be reset. You cannot change the planned test case.
This endpoint is still functional but is deprecated. Please use the newer /test-plan-items/{id} endpoint above instead.
Delete test plan item(s) from an iteration or a sprint requirement version
A DELETE to /test-plan-items/{testPlanItemsIds} deletes one or several test plan items with the given id(s).
Path parameters
| Parameter | Description |
|---|---|
|
the list of ids of the test plan items |
HTTP request
DELETE /api/rest/latest/test-plan-items/45,46 HTTP/1.1
Content-Type: application/json
Accept: application/json
Host: localhost:8080
Delete test plan item(s) (deprecated)
A DELETE to /iteration-test-plan-items/{testPlanItemsIds} deletes one or several test plan items with the given id(s).
This endpoint is still functional but is deprecated. Please use the newer /test-plan-items/{testPlanItemsIds} endpoint above instead.
Get executions of a test plan item
A GET to /test-plan-items/{id}/executions returns all the executions of the test plan item with the given id.
Path parameters
| Parameter | Description |
|---|---|
|
the id of the test-plan-item |
HTTP request
GET /api/rest/latest/test-plan-items/1/executions?size=3&page=1 HTTP/1.1
Accept: application/json
Host: localhost:8080
Query parameters
| Parameter | Description |
|---|---|
|
number of the page to retrieve (optional) |
|
size of the page to retrieve (optional) |
|
which attributes of the returned entities should be sorted on (optional) |
|
which fields of the elements should be returned (optional) |
HTTP response
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: 1797
{
"_embedded" : {
"executions" : [ {
"_type" : "execution",
"id" : 10,
"name" : "TC1 - Test Case 1",
"execution_order" : 0,
"execution_status" : "FAILURE",
"last_executed_by" : "User 8",
"last_executed_on" : "2017-06-12T10:00:00.000+00:00",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/executions/10"
}
}
}, {
"_type" : "execution",
"id" : 11,
"name" : "TC1 - Test Case 1",
"execution_order" : 1,
"execution_status" : "BLOCKED",
"last_executed_by" : "User 8",
"last_executed_on" : "2017-06-13T10:00:00.000+00:00",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/executions/11"
}
}
}, {
"_type" : "execution",
"id" : 12,
"name" : "TC1 - Test Case 1",
"execution_order" : 2,
"execution_status" : "SUCCESS",
"last_executed_by" : "User 8",
"last_executed_on" : "2017-06-14T10:00:00.000+00:00",
"_links" : {
"self" : {
"href" : "http://localhost:8080/api/rest/latest/executions/12"
}
}
} ]
},
"_links" : {
"first" : {
"href" : "http://localhost:8080/api/rest/latest/test-plan-items/1/executions?page=0&size=3"
},
"prev" : {
"href" : "http://localhost:8080/api/rest/latest/test-plan-items/1/executions?page=0&size=3"
},
"self" : {
"href" : "http://localhost:8080/api/rest/latest/test-plan-items/1/executions?page=1&size=3"
},
"last" : {
"href" : "http://localhost:8080/api/rest/latest/test-plan-items/1/executions?page=1&size=3"
}
},
"page" : {
"size" : 3,
"totalElements" : 6,
"totalPages" : 2,
"number" : 1
}
}
Response fields
| Path | Type | Description |
|---|---|---|
|
|
the list of elements for that page |
|
|
the page size for that query |
|
|
total number of elements the user is allowed to read |
|
|
how many pages can be browsed |
|
|
the page number |
|
|
related links |
Links
| Relation | Description |
|---|---|
|
link to the first page (optional) |
|
link to the previous page (optional) |
|
link to this page |
|
link to the next page (optional) |
|
link to the last page (optional) |
Get executions of a test plan item (deprecated)
A GET to /iteration-test-plan-items/{id}/executions returns all the executions of the test plan item with the given id.
This endpoint is still functional but is deprecated. Please use the newer /test-plan-items/{id}/executions endpoint above instead.